I have a page where I am loading a another page and a js file. The child page has a hidden field
<input type="hidden" name="eventOk" id="eventOk" value="" />
This child page has a an event which is setting value of this variable:
function onEndClientCallBack(sender, eventArgs) {
$('#eventOk').val('5')
alert('1 value is' + $('#eventOk').val());
}
The alert is showing that value is set properly. Now I want to use this value inside the js file which is loaded in the frame but when I alert the value it shows blank value. how can I set the value in aspx page and use in js file ?
Please suggest. Thanks.
You have to add runat=”server” attribute to the hidden field to access that in your server side code.
Then you can use the following code to set the value (C#)
and your jQuery code will be