Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

AJAX UpdatePanel Contents Disappearing

ajax asp.net c# updatepanel

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 Tchpowdog

Tchpowdog

    CC Regular

  • Member
  • PipPipPip
  • 44 posts

Posted 05 November 2014 - 11:24 AM

This is very simple.  I have an UpdatePanel that contains a Weather.com widget.  On my page, I have a timer that ticks every 15 sec and updates a few things on my page.  Below is my timer_tick event and the HTML code for weather widget.  Everything in the timer_tick event for great except for UpdatePanel4.Update().  When this fires, my widget disappears...
 
aspx.cs:
protected void Timer1_Tick(object sender, EventArgs e)
        {
            dateLbl.Text = DateTime.Now.ToLongDateString();
            timeLbl.Text = DateTime.Now.ToShortTimeString();
            UpdatePanel4.Update();
            UpdateStats();
        }
 
aspx:
<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="weatherComDiv">
            <script type="text/javascript" src="http://voap.weather.com/weather/oap/USLA0033?template=GENXV&par=3000000007&unit=0&key=twciweatherwidget"></script>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>


#2 Amonijack

Amonijack

    CC Resident

  • Advanced Member
  • PipPipPipPip
  • 89 posts

Posted 07 November 2014 - 03:14 PM

I think you should add trigger to your Update Panel.


Edited by Amonijack, 07 November 2014 - 03:15 PM.