Suppose you have a Web server control called TextBox in your Web page:
<asp:TextBox id="Test" Text="Sample" runat="server">
You can access this value in a couple ways using JavaScript: -
document.getElementById('<%=Test.ClientID%>').value; ClientID - server control identifier generated by ASP.NET
-
document.forms[0]['Test'].value;
Note: Copy - Paste from this site http://www.devx.com/tips/Tip/28332
No comments:
Post a Comment