asp.net文件上传控制问题 [英] asp.net File upload control problem

查看:85
本文介绍了asp.net文件上传控制问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个aspx页面,要求用户输入名字,姓氏并上传图片。

我在a上调用ajax [WebMethod]。 cs文件通过jquery在sql数据库中保存表单数据。但是,我无法访问asp.net FileUpload控件。

如何上传图片并发送字节?





谢谢

Hi,
I have a aspx page that ask user to enter firstname, last name and upload an image.
I am calling ajax [WebMethod] on a .cs file through jquery to save form data on sql database. However, I am unable to access the asp.net FileUpload control.
How can I upload an image and send its bytes?


Thanks

推荐答案

使用Ajax更新面板..

以下示例对您有用...

Bcos我在使用FileUpload控件时遇到了同样的问题。



示例:



Use Ajax update panel..
The Example Below will be useful for you...
Bcos I got the same problem while using FileUpload control.

Example:

< br $>







    <table>
    <tr>
    <td>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:FileUpload ID="FileUpload1" runat="server" />
            <asp:Button ID="Button1" runat="server"
                Text="Save" onclick="Button1_Click1" />
        </ContentTemplate>
        <Triggers>
        <asp:PostBackTrigger ControlID="Button1" />
        </Triggers>
        </asp:UpdatePanel>

    </td>
    </tr>
    </table>
</fieldset>
</div>


这篇关于asp.net文件上传控制问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆