Showing posts with label postbacks. Show all posts
Showing posts with label postbacks. Show all posts

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>

Wednesday, March 21, 2012

Declarative Postbacks in Beta 2

Hello,

I had a small script function to perform a declarative postback. This worked in the July CTP, and we are in the process of upgrading to Beta 2. It is erroring out on not being able to locate the Sys.WebForms.PostBackAction type. Has this been removed/moved? If so, could someone point me in the direction of where it is hiding?

function postbackFromJS(sender, e) {
var postBack = new Sys.WebForms.PostBackAction();
postBack.set_target(sender);
postBack.set_eventArgument(e);
postBack.performAction();
}

Thanks!

I looked around the PageRequestManager class and couldn't find much so it looks like it was removed, though not sure if it was renamed. The docs are lacking in this area.

Anyways, here's the class you can take a look around:http://ajax.asp.net/docs/ClientReference/Sys.WebForms/PageRequestManagerClass/default.aspx


hello.

the postbackaction is defined on the preview.js file (ie, in the value-added bits).