Sunday, March 11, 2012

Passing an element id through javascript...

I'm not really sure what you are traying do do, but if I understand correctly you can use the context parameter when you call the webmethod like this:

function CallWebMethod()
{
TreStringheService.GetTreStringhe("0100012",Fill,ErrorHandler,"lblMsg");
}

Your fill method would look like this:

function Fill(result, eventArgs, context) {
var lblMsg = $get(context);
lblMsg.innerHTML = result;
}

For more information on webservices check out these links:

http://www.asp.net/ajax/documentation/live/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx

http://www.asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx

Hope this helps,
Elias.

No comments:

Post a Comment