Basically, I have an asp.net ajax enabled usercontrol, and now I’d like to just return a simple string value, to be used in some js I’m firing after the ajax request is done.
I’ve been fiddling around with the endrequest method, which I already set up to use for exception handling, which works fine. But is there no way to simply return a string value?
First I thought I could do this through Response.Write(); but args.get_response() doesn’t like when you do that apparantly – can anyone point me in the right direction?
Thanks!
You can use the ScriptManager.RegisterDataItem method with the Sys.WebForms.PageRequestManager. Consider the following test page which when you click the button it registers data item with the script manager and at the client side it handles the endrequest and get that data item,