Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 38 characters in body
Source Link
KrishnaDhungana
  • 2.7k
  • 4
  • 29
  • 37

You can save value in Hidden Field

Aspx:

<asp:HiddenField ID="CustomHiddenField" runat="server" ClientIDMode="Static" /> 

In code behind file :

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "someval=" + this.CustomHiddenField.Value, true); 

Jquery:

$(document).ready(function () { var value= someval; $('#htmlemement').val(value); 

});

Aspx:

<asp:HiddenField ID="CustomHiddenField" runat="server" ClientIDMode="Static" /> 

In code behind file :

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "someval=" + this.CustomHiddenField.Value, true); 

Jquery:

$(document).ready(function () { var value= someval; $('#htmlemement').val(value); 

});

You can save value in Hidden Field

Aspx:

<asp:HiddenField ID="CustomHiddenField" runat="server" ClientIDMode="Static" /> 

In code behind file :

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "someval=" + this.CustomHiddenField.Value, true); 

Jquery:

$(document).ready(function () { var value= someval; $('#htmlemement').val(value); 

});

Source Link
KrishnaDhungana
  • 2.7k
  • 4
  • 29
  • 37

Aspx:

<asp:HiddenField ID="CustomHiddenField" runat="server" ClientIDMode="Static" /> 

In code behind file :

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "someval=" + this.CustomHiddenField.Value, true); 

Jquery:

$(document).ready(function () { var value= someval; $('#htmlemement').val(value); 

});