I am using ASP.NET Callbacks (that implements the ICallbackEventHandler) and in the handler, I try to set a value of the text box:
txtName.text = "Test";
but this value is not set. Is this a limitation with callback? It appears I cannot do much in a callback handler other than sending back a string to the client side (ofcourse I can access the Session etc)
Even though you are calling back to the server, the whole page is not processed and sent back to the client. Thus, changes you make to controls server-side will not be reflected client-side.
Controls like the GridView uses callbacks in order to do some processing on the server while not incurring a full postback. Think of it as a form of AJAX. The GridView, upon receiving the string response you mention, is responsible for interpreting the string and updating its own state client-side using javascript.
Clarification: as described here:
so no, ASP.Net will not do a full page lifecycle, and no, no html will be returned to the client. Unless you return some html yourself in the
GetCallbackResultmethod.Idea: instead of doing callbackeventhandlers, take a look at JQuery with ASP.Net AJAX and more on the state of things here. This would enable your scenario with much of the plumbing already in place done by Microsoft.