在更新面板中上传图片 [英] image upload in update panel

查看:63
本文介绍了在更新面板中上传图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

如果将fileupload放在更新面板中,则无法将图像插入数据库,任何人都可以尽快给我帮助.

Hello,

I am unable to insert the images to the database if i place fileupload inside the update panel, can any one help me asap.

推荐答案

与UpdatePanel不兼容的控件控件
以下ASP.NET控件与部分页面更新不兼容,因此在UpdatePanel控件内不受支持:

1)TreeView和Menu控件.

2)Web部件控件.有关更多信息,请参见ASP.NET Web部件控件.

3)FileUpload控制何时使用它们作为异步回发的一部分来上载文件.

4)GridView和DetailsView控制何时将其EnableSortingAndPagingCallbacks属性设置为true.默认值为false.

5)登录,密码恢复,ChangePassword和CreateUserWizard控件的内容尚未转换为可编辑模板.

6)替代控件.

7)验证控件,包括BaseCompareValidator,BaseValidator,CompareValidator,CustomValidator,RangeValidator,RegularExpressionValidator,RequiredFieldValidator和ValidationSummary控件.

参考: http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx [ ^ ]

http://forums.asp.net/t/1415400.aspx/1 [ ^ ]
Controls that Are Not Compatible with UpdatePanel Controls
The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside an UpdatePanel control:

1)TreeView and Menu controls.

2)Web Parts controls. For more information, see ASP.NET Web Parts Controls.

3)FileUpload controls when they are used to upload files as part of an asynchronous postback.

4)GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false.

5)Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates.

6)The Substitution control.

7)Validation controls, which includes the BaseCompareValidator, BaseValidator, CompareValidator, CustomValidator, RangeValidator, RegularExpressionValidator, RequiredFieldValidator, and ValidationSummary control.

Ref: http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx[^]

http://forums.asp.net/t/1415400.aspx/1[^]


触发上传图像.

you use Trigger for Upload the Image.

<asp:ScriptManager ID="sc1" runat="server"></asp:ScriptManager>
 <asp:UpdatePanel ID="u1" runat="server">
 <ContentTemplate>
// content of your page

</ContentTemplate>
<Triggers>
    <asp:PostBackTrigger   ControlID="Button1" />

</Triggers>
</asp:UpdatePanel>


Button1 is submit button when you click after the Upload image.

this will help you.


这篇关于在更新面板中上传图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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