I’m making an ajax request and storing my response in an hidden field.I’m doing this through javascript using getelementbyid.value.This javascript function is on body onload.Now after I get this value I would like to use this in C#.I can’t have any button onclick event or anything of that sort.Just have a hidden input type
Share
If an asp.net HidenField webControl has a value then all you need to do is the following:
aspx page:
cs page:
If you want to do something with the value when it’s assigned handle the onValueChanged event:
While you CAN use a value of an asp.net HiddenField that is set using javascript in C# make sure that you understand that this can only be done after a postback.
Here is some info on the Client/Server relationship. Javascript and C# respectively in your question.