Showing posts with label built. Show all posts
Showing posts with label built. Show all posts

Monday, March 26, 2012

Pagemethods timeout

Is there a built in way to timeout a pagemethod request?
I have tried this

PageMethods.Timeout(key, OnSucceeded, OnFailed,OnTimeOut);

But the OnTimeOut Method never gets called.


The Current version does not have explicit OnTime Callback like the previous versioin instead it is handled in the OnError Callback. Like the Following:

SimpleService.SimpleMethod(function(result) // Success Handler
{
},
function(exceptioin) // Error Handler
{
if (exception.get_timeout())
{
// Timeout
}
else
{
//All other error.
}
}
);


Thank you for your reply.

I have tried this and I still do not get any call to the Error function.

Is there a place where I can look at the documentation for this. I have been searching for it but can't find anything.


Does your Succes Handler Executes, Did you enabled the ScriptManager EnablePageMethods?


Yes, the success handler does execute. Is there a way to set the timeout time? Maybe it is just too long.

Even it takes long time the OnError Callback should be executed. Anyway you can increase the timeout by setting like the following:

PageMethods.set_timout(120);

I have seen the light :) Thanks so much for your help.
It would be nice if this was documented somewhere.

Thanks again.


Would you mind posting the codes, so that i can investigate.

PageRequestManagerServerErrorException

I have a web application built using ASP.NET Ajax 1.0. And now, I have a problem because when the IIS Server is restarted or not available the ajax engine display a message box with PageRequestManagerServerErrorException (Error 500). I would like to know if is possible treat this message and display a friendly message to user. How can I do this?I'm having the same error message pop up randomly after a page has been open for a while. I'm beginning to wonder if it is caused by Session going out of scope. With ASP.NET AJAX 1.0, do AJAX requests within an UpdatePanel moved the Session sliding expiration at all?

Hi,

This exception is thrown at the server. While in an async postback the normal exception/debug chain of the ASP.NET pipeline is ignored by default. You can either enable the normal custom error stuff in web.config by setting ScriptManager.AllowCustomErrorsRedirect on the current script manager to true, or you can handle the exception yourself at the server side by hooking to the AsyncPostBackError event on the script manager, or (if you just want to replace the message sent to the client and no more) you can set the AsyncPostBackErrorMessage.

Since async postbacks will still run through the session module at AcquireRequestState time, it seems unlikely that your sliding expiration interval is not updated. However, if you don't post back for a long period, your session will of course be abandoned. But this will not cause an exception, but rather just start a new session ...

-- Henkk


I found the problem, sorry I forgot to post it.

This error always occurred after a complete postback. I switched the postback out for an async postback, and the errors went away. Basically what was happening was that the user would sometimes be able to click on a control that would trigger an async postback before the entire page was rendered by the browser. This would break the AJAX scripts and throw that error message.

Thank you for the help with the custom errors, though!


I found what the error was. Apparently it always occurred after a regular postback so I was able to track it down. Users were sometimes able to click on a control that fired off an async postback before the entire page was able to load. This would break the AJAX scripts and throw the error.

Thanks for the help with the custom error messages!


Hello!!I have a page that has a textbox, a dropdownlist, a second textbox inside an update panel, and a second updatepanel with final textbox in it. I also have a calculate button

I am entering a number in first textbox and change selection in dropdownlist. It does an async postback with selectedIndexchanges and populates the second text box. Now when I press a calculate button the textbox in second update panel is supposed to return with values.

Both update panels are updatemode = conditional. First one is fired on selectedindexchanged of the dropdownlist and second on click of calculate button.

Everything works the first time. As soon as I calculate once, any subsequent calls to calculate or changing of the dropdown list gives the above error with server code = 500

How should I go about it?


In the calculate method, is there a control being updated that is NOT within the triggered UpdatePanel? That could be causing the issue.