I am using the below code to assign the value to a hidden control.But in code behind i can't get the value of the hidden control. Please help me to get this.I tried more time.
Script
=======
<script type="text/javascript">
function load_value() {
var val = document.getElementById('<%= hf_xml.ClientID %>');
val.value= "hai";//Whatever i want
alert(val.value);//alert message show with text hai
}
window.onload = load_value;
</script>
<asp:HiddenField ID="hf_xml" runat="server" />
Code Behind
===========
protected void Page_Load(object sender, EventArgs e)
{
string value = hf_xml.Value;//Always Empty
}