Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
aspx page
<head>
C#
<script language="Javascript">
function country() {
           var country = "HI";
           var hiddenControl = '<%= inpHide.ClientID %>';
           document.getElementById(hiddenControl).value = country;
       }
</script>

</head>
<body>
<form id="form1" runat="server">
XML
<asp:HiddenField ID="inpHide" runat="server" />
       <asp:Label ID="lblMsg" runat="server" />

</form>
</body>

code behind

C#
protected void Page_Load(object sender, EventArgs e)
    {
        lblMsg.Text = inpHide.Value;
    }
Posted
Comments
BulletVictim 20-Jan-14 1:06am    
Have you tried doing it like this:
<script language="Javascript">
function country() {
var country = "HI";
document.getElementById(inpHide).value = country;
}
</script>

1 solution

call
XML
<body onload="bind()">


add script as follows
XML
<script language="Javascript">
 function bind() {
var value = "value which you want to display"; document.getElementById(lblMsg).value = value; }
</script>

Please check and inform is this solve your problem or not?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900