Monday, March 26, 2012

detecting partial page postback

I read it somewhere here before, but can;t seem to find the reference today.

What is the code for separating the different types of postbacks (full page, partial postback, etc.)? I need to do this prammatically from a user control.

Hi,

You have ScriptManager.IsInAsyncPostBack to check if the page is performing an asyncpostback and UpdatePanel.IsInPartialRendering to check whether that particular updatepanel is performing a partial rendering.

Hope this helps,

Juan


Thanks for the info, that helps alot.

For anyone out there doing this from within a usercontrol, here is some code:

Dim tempScriptAs ScriptManager

tempScript =CType(page.FindControl("scriptManager1"), ScriptManager)

Dim asyncAsBoolean = tempScript.IsInAsyncPostBack

--

<

asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true">

</asp:ScriptManager>

No comments:

Post a Comment