We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

UpdatePanel is used in ASP.NET for doing partial postback. Suppose you are having a page and you want some portion of that page to be refreshed or changed, so in that case why refresh the whole page. In this scenario we may use UpdatePanel and the control inside that updatepanel will get refreshed or changed not the full page(if we want to refresh the whole page then we can do that also).

Apart from that we can have controls which will act as the trigger for partial postback of the updatepanel.It can be a child control(Control inside the updatepanel) or a control outside the update panel.

But the main thing is that updatepanel is associated with different modes, so which mode to use in which scenario .

Update Mode : Always , Conditional.

Always :

ChildrenAsTrigger - false   -- Illegal parameters.

ChildrenAsTrigger - true    -- UpdatePanel refreshes if the whole page refreshes or when a child control inside the UpdatPanel postsback.


Conditional :

ChildrenAsTrigger - false   -- UpdatePanel refreshes if the whole page refreshes or when a trigger control outside the UpdatPanel initiates a refresh.

ChildrenAsTrigger - true    -- UpdatePanel refreshes if the whole page refreshes or when a child control inside the UpdatPanel postsback or when a trigger control outside the UpdatPanel initiates a refresh.

How to distinguish between postback and asynchronous postback ?
In code behind we are using Page.IsPostback property to know whether it the firsttime page load ro page postback.But in case of asynchronous page postback we can't know whether it is asynchronous page loading or not by using the same property.

We can use ScriptManager1.IsInAsyncPostBack property to know whether it is a asynchronous page postback or not.where ScriptManager1 is the ID of the ScriptManager.


Related Tags:

ASP.NET, UpdatePanel

Author: Devi Das

top

ASP.NET

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login