Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ajax Toolkit-- Is UpdatePanel suppose to reload the entire page

Status
Not open for further replies.

mbde

Programmer
Mar 14, 2005
55
US
Right now I have a master page. In the master I have a script manager, a Update Panel, a Label and a timer.

Right now I am just putting the time in the label, if I get this to work I will want to do something more advance of getting a status from a database. But the concept is the same

I have tried putting the timer in the UpdatePanel with ChildernAsTriggers and outside the UpdatePanel with a TriggerCollection for AsyncPostback.

Both ways cause the Content portion of the page to reload time and time again. I was under the impression that only the functions in the UpdateTrigger collection get invoked. Is it normal for this to happen, am I setting up the Panel incorrectly?

Code:
 <asp:ScriptManager ID="smDynamicClock" runat="server"></asp:ScriptManager>
        <asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick">
        </asp:Timer>

Code:
<asp:UpdatePanel runat="server" ID="upDynamicClock" ChildrenAsTriggers="False" 
                        RenderMode="Inline" UpdateMode="Conditional">
                        <ContentTemplate>
                        <asp:Label runat="server" ID="lblDynamicClock"></asp:Label>
                        </ContentTemplate>
                    
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                        </Triggers>
                    
                    </asp:UpdatePanel>
Thanks
 
Code:
<asp:UpdatePanel runat="server" ... PartialPage="true" />
or something like that. it's been a long time since I used webcontrols or MS AJAX.

One thing to note. While the update panel removes the page refresh it still preforms an entire page postback behind the scenes. This means that there is no preformance gain from using an update panel. All you really gain is the appearance of no postback. There is an article on MSDN Wicked Code explaining this. This may be it
Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top