Showing posts with label onsucceeded. Show all posts
Showing posts with label onsucceeded. Show all posts

Wednesday, March 28, 2012

PageMethod Context parameter

var context = new Array()

I am trying to invoke PageMethod.DoSomething(parameter1, parameter2, OnSucceeded, null,null,null,context)

so context is an array

But in the OnSucceeded(result,response,context) the context parameter contains the name of the page and the method called. It is not returning back the context that I called it with.

Any help will be greatly appreciated.

Thanks

Try to?take?a?look?at?this?blog?about?how?to?use?PageMethod?in?Ajax?RC?1.0?-?http://blogs.gotdotnet.com/robj/archive/2007/01/05/pagemethods-in-asp-net-ajax-1-0-rc.aspx
Wish this can help you.

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.