-1

The update panel control is not working in normal mode i.e. when i am browsing it without debugging while in debug mode it is working absolutely fine.

My code is as follows-

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> 
<ContentTemplate>
<asp:Timer runat="server" id="Timer1" Interval="5000"></asp:Timer>

<%--  web content here --%>

</ContentTemplate>
</asp:UpdatePanel>

Please suggest for working of the above in normal mode without debugging. Thanks in advance.

2 Answers2

0
`<head runat="server">
 <title></title>
 <meta http-equiv="refresh" content="10" />
 </head>

 <body>
 <form id="form1" runat="server">
 <asp:ScriptManager ID="ScriptManager1" runat="server" />
 <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
 <ContentTemplate>
 <%--  web content here --%>
 </ContentTemplate>
 </asp:UpdatePanel> 
 </form>
 </body>
 </html>

 in .cs page i used
 protected void Page_Load(object sender, EventArgs e)
 {
   UpdatePanel1.Update();
 }`

i used simple meta tag in under the tag in desing page, its working fine for refresh page

M.Y.Mnu
  • 718
  • 8
  • 22
  • I am not willing to refresh the entire page. My requirement is to get the changed attributes from database every 10 seconds without refreshing it. – RAJ SRIVASTAVA Aug 06 '16 at 03:24
0

The META tag will refresh the entire page, before calling the Page_Load method.

I also noticed that updatepanels stopped working for me too, after .NET4.5. Maybe its a bug in the framework, or maybe something is blocking it. Its even worse when you are using bootstrap with your project. As UpdatePanels are script driven, some hidden bootstrap script may be interfering with it.

So, if its not too much trouble, you could wire up all ur events using jQuery, and where you need to make server calls, you can use ajax to call a project-hosted webservice. This way, your page doesn't load at all, unless u want it to.

Mr. Whales
  • 11
  • 4