at JavaScript <script>SetHiddenVariable()</script> <script type="text/javascript"> function SetHiddenVariable() { var jsVar = "dotnetcurry.com"; var hiddenControl = '<%= inpHide.ClientID %>'; document.getElementById(hiddenControl).value = jsVar; } </script> --------------------------------------------- at html form <input id="inpHide" type="hidden" runat="server" /> <asp:TextBox ID="txtJSValue" runat="server"></asp:TextBox> <asp:Button ID="btnJSValue" Text="Click to retreive Javascript Variable" runat="server" onclick="btnJSValue_Click"/> ----------------------------------------- at c# protected void btnJSValue_Click(object sender, EventArgs e) { txtJSValue.Text = inpHide.Value; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)