“嵌套更新”面板中的图像未在回发时刷新 [英] Image in Nested Update panel is not getting refreshed on postback

查看:57
本文介绍了“嵌套更新”面板中的图像未在回发时刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..!



我的aspx页面中有两个嵌套的updatepanels。



In子更新面板,我有一个图像控件。

我正在使用图像按钮刷新后面代码中图像控件的图像。



但是,它没有像我期待的那样工作。这是我的.aspx页面代码,



Hi..!

I have two nested updatepanels in my aspx page.

In the child update panel, i have an image control.
I'm using an image button to refresh the image of the image control in the code behind.

But, its not working as i'm expecting. Here is my .aspx page code,

<asp:UpdatePanel ID = "up1" runat = "server" >
   <ContentTemplate>
   <asp:UpdatePanel ID = "xxx" runat = "server" >
   <ContentTemplate>
      <fieldset style="padding:10px;width:30%;">

         <asp:Image ID="ImageCaptcha" ImageUrl="~/captcha.ashx"  

            runat="server" Height="50px" AlternateText="If you can't 
            read this number refresh your screen" Width="124px" /><br />

         <asp:ImageButton ID="btnRefresh" runat="server" 

            Width="20px" TabIndex="17" 

            ImageUrl="~/Images/refreshimg.jpg" Height="16px" 

            ToolTip="Refresh Code" meta:resourcekey="btnRefreshResource1" 

            CausesValidation="true" />
        
         <asp:Button ID="btnSubmit" runat="server" 

            Height="28px" meta:resourcekey="btnSubmitResource1" 

            Text="Create" Width="109px" TabIndex="18" />

      </fieldset>
   </ContentTemplate>
</asp:UpdatePanel>
<pre>&lt;/ContentTemplate&gt;
&lt;/asp:UpdatePanel&gt;







Code Behind是,






Code Behind is,

Protected Sub btnRefresh_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnRefresh.Click

       ImageCaptcha.ImageUrl = "~/logo.jpg"
   End Sub

推荐答案

你可以使用xxx.Update();要强制更新面板,但是为了做到这一点,你必须在aspx中设置UpdatePanel = UpdatePanel标签的条件。
You can use xxx.Update(); to update the panel forcefully, however you have to set UpdateMode = Conditional of the UpdatePanel tag in aspx in order to do that.


对不起,对不起。我早就解决了这个问题。这是因为浏览器的缓存而发生的。我已禁用缓存,现在每件事情都运行正常。谢谢每一个人。
Sorry for the late. I have Solved the issue long back. This is happening because of browser's cache. I have disabled cache and every thing is working fine now. Thanks Every one.


这篇关于“嵌套更新”面板中的图像未在回发时刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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