WebDataGrid - AJAX Postback vs Full Page Postback

Answered (Verified) This post has 1 verified answer | 9 Replies | 4 Followers Thread's RSS feed.

yen
Points 130
Replied On: Tue, Mar 6 2012 2:23 AM Reply

For the older UltraWebGrid, we were able to use grid.IsXmlHttpRequest to differentiate between the grid's AJAX postback vs a full page postback, where the AJAX postback was initiated by grid.invokeXmlHttpRequest(...).

In the new WebDataGrid, is there a way to differentiate between a full page postback vs the AJAX postback of the grid, say in the grid Load event handler? I want to perform different actions depending upon how the grid is posted back.

I'm using the following Javascript perform an AJAX postback on a WebDataGrid to retrieve data from a database.

    var grid = $find("WebDataGrid1");
    var callbackObject = grid._callbackManager.createCallbackObject();
    grid._callbackManager.execute(callbackObject);

 

  • Post Points: 20

Verified Answer

[Infragistics]Mike P
Points 23,565
Infragistics Employee
Answered (Verified) Replied On: Thu, Mar 15 2012 9:31 AM Reply

Hello yen,

I have heard back from development concerning this matter. You can use the following code to determine if a postback was async for the WebDataGrid:

WebDataGrid1.RunBot.IsCallback

I have attached a sample to demonstrate this behavior. The sample has selection enabled to cause a postback when the selection changes and there is an Html Input button to cause a postback.

Please let me know if you have any questions concerning this matter.

Sincerely,
Mike P.
Software Developer
Infragistics, Inc.
www.infragistics.com

  • Post Points: 55

All Replies

[Infragistics]Mike P
Points 23,565
Infragistics Employee
Replied On: Tue, Mar 6 2012 12:33 PM Reply

Hello yen,

You can check if a post back is asynchronous through the page’s ScriptManager. The ScriptManager has a property called IsInSyncPostBack that indicates whether the current postback is async. If the postback is being done asynchronously IsInAsyncPostBack would be set to true. You can find further information about this property in the following link:

http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.isinasyncpostback.aspx

Please let me know if you have any questions concerning this matter.

Sincerely,
Mike P.
Software Developer
Infragistics, Inc.
www.infragistics.com

  • Post Points: 20
yen
Points 130
Replied On: Tue, Mar 6 2012 7:08 PM Reply

Mike,

Thanks for the quick response.

IsInAsyncPostBack is FALSE for both the Call Back Manager AJAX postback (above) and grid paging AJAX postback.

The only instance where I can get the IsInAsyncPostBack to be true is if I enclose the grid in an Update Panel and post it back (partial postback).

Is there anything else that I can use?

Regards,

Yen

  • Post Points: 20
[Infragistics]Mike P
Points 23,565
Infragistics Employee
Replied On: Fri, Mar 9 2012 4:45 PM Reply

Hello Yen,

Thank you for the update. I am currently looking into this matter to see if there is an alternate way to check if the postback was async. It appears that this method checks for the page and it may be necessary to check at the control level. I will continue to look into this matter and provide you with a progress update by Wednesday.

Sincerely,
Mike P.
Software Developer
Infragistics, Inc.
www.infragistics.com

  • Post Points: 5
[Infragistics]Mike P
Points 23,565
Infragistics Employee
Replied On: Wed, Mar 14 2012 4:50 PM Reply

Hello yen,

Thank you for your patience. I have done some further research into this matter and have been unable to find a method to check for an async postback. I have contacted our development team and will update you with the information they provide. I will give you a progress update by Monday.

Sincerely,
Mike P.
Software Developer
Infragistics, Inc.
www.infragistics.com

  • Post Points: 5
[Infragistics]Mike P
Points 23,565
Infragistics Employee
Answered (Verified) Replied On: Thu, Mar 15 2012 9:31 AM Reply

Hello yen,

I have heard back from development concerning this matter. You can use the following code to determine if a postback was async for the WebDataGrid:

WebDataGrid1.RunBot.IsCallback

I have attached a sample to demonstrate this behavior. The sample has selection enabled to cause a postback when the selection changes and there is an Html Input button to cause a postback.

Please let me know if you have any questions concerning this matter.

Sincerely,
Mike P.
Software Developer
Infragistics, Inc.
www.infragistics.com

  • Post Points: 55
yen
Points 130
Replied On: Thu, Mar 15 2012 7:52 PM Reply

 Mike,

Exactly what I was looking for.

Thanks for you assistance.

Yen

  • Post Points: 5
ygalanter
Points 1,290
Replied On: Fri, Apr 13 2012 11:08 AM Reply

Doesn't work for WHDG. When I click [+] to expand Children and Ajax method is called  WHDG's RunBot.IsCallback is False. Any way to detect this call?

  • Post Points: 5
Andrei Ladunca
Points 5
Replied On: Thu, Aug 29 2013 4:29 AM Reply

Hi, I'm having the same issue with the WebTab control, but this one does not have a RunBot instance. 

Thanks in advance,

Andrei

  • Post Points: 5
Page 1 of 1 (10 items) | RSS