的ImageButton不火的UpdatePanel中 [英] Imagebutton does not fire in UpdatePanel
问题描述
我想显示一个进度形象,当我点击里面的UpdatePanel的ImageButton的。在按钮单击C#code应该运行以及显示更新进度的形象。有了这个code,它运行在C#code,但犯规显示进度的形象,如果我删除postbacktrigger,那么就说明形象进度但C#犯规运行。任何想法,我该如何解决?
< DIV ID =ScriptManager的>
< ASP:的ScriptManager ID =ScriptManager1=服务器>
< / ASP:ScriptManager的>
< ASP:的UpdatePanel ID =UpdatePanel1=服务器ChildrenAsTriggers =真> <&的ContentTemplate GT;
< ASP:ImageButton的ID =ImageButton1=服务器的ImageUrl =〜/图片/ SurveyImages / clean.jpg
的onclick =cmd_clean_emergency_Click
风格= - WebKit的外观:按钮式;边界半径:5像素;边界:4PX固体#E9A732启用=FALSE
/>
< /&的ContentTemplate GT;
<&触发器GT;
< ASP:PostBackTrigger控件ID =ImageButton1/>
< /触发器>
< / ASP:的UpdatePanel>
< ASP:的UpdateProgress ID =UpdateProgress1DisplayAfter =0=服务器AssociatedUpdatePanelID =UpdatePanel1>
< ProgressTemplate>
< IMG SRC =图像/ ProgressBar1.jpg/> < / ProgressTemplate>
< / ASP:&的UpdateProgress GT;
< / DIV>
这是我的错误与AsyncPostBack触发它的作品。我忘了把GridView控件的UpdatePanel标签内,所以C#code的实际运行,但GridView控件没有更新,因为它不是在UpdatePanel标签内。
I am trying to show a progress image when I click an Imagebutton inside updatepanel. On button click c# code should run as well as show the update progress image. With this code, it runs the c# code but doesnt show the progress image, if i remove the postbacktrigger, then it shows the progress image but the c# doesnt run. Any idea how can I fix it ?
<div id="scriptmanager">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/SurveyImages/clean.jpg"
onclick="cmd_clean_emergency_Click"
style="-webkit-appearance:push-button; border-radius:5px; border: 4px solid #E9A732" Enabled="False"
/>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImageButton1"/>
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" DisplayAfter="0" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<img src="images/ProgressBar1.jpg" />
</ProgressTemplate>
</asp:UpdateProgress>
</div>
It was my mistake with AsyncPostBack trigger it works. I forgot to put GridView inside updatepanel tag, so the c# code was actually running, but gridview was not updating because it was not inside the updatepanel tag.
这篇关于的ImageButton不火的UpdatePanel中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!