Question

I have a javascript call to a C# WebMethod. The same page has another call and it is working. I debugged the javascript code, this is called:

function userUpdReq_onOk()
{
...
var clientValidationPassed =Page_ClientValidate();

if( clientValidationPassed )
{
PageMethods.RequestUserUpdate(username, email, sex, zipCode, state, city, neighborhood, address, addressNumber, addressComplement, phone, promotionalInfo, connectionType, connectionSpeed, userUpdReq_OnComplete, userUpdReq_OnError);
}
...
}

The debugger passes by this line, but the next method it enters is userUpdReq_OnError( ). Why does it happen?

Was it helpful?

Solution

What is the message in error argument passed to userUpdReq_OnError()?

The OnError method is called when an error occurs inside of your page method. Sometimes this will be a casting issue, or a server error for some other reason. The error message passed to your OnError method should be able to guide you to the reason for the failure.

To get the error message, you can define the error handler as follows:

function userUpdReq_OnError(error){}

The error parameter will have a message indicating the reason for the failure.

OTHER TIPS

Here is another issue "innocent" I think but it givme a lot troubbles, however, for some unknown reason, in some place aspx lost some reference to ScriptManager, so, what we must do to fix it is remove ScriptManager from aspx, add it again and set EnablePageMethods located in properties window to true.

Regards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top