Hi, I'm trying to set the value of a hiddenfield control in an AJAX initialize request handler. However on the server the hidden field control always contains the value for the previous postback. I presume the viewstate is being prepared / send before I set the hidden field in the initialize request handler. Is there any way to set the hidden field so that is passes the new value through or perhaps pass a value to the server via another mechanism.
This is the code I'm using:
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(MyPage_initializeRequestHandler);
function MyPage_initializeRequestHandler(sender, args)
{
var hiddenField1= $get('hiddenField1');
if (hiddenField1 != null)
{
hiddenField1.value = 'test';
}
}
Many thanks.