Expand|Select|Wrap|Line Numbers
- <layouttemplate>
- <asp:TextBox id="TxtUser" runat="server" />
- <asp:Button id="myButton" runat="server" OnClientClick="myJavascriptFunction" />
- </layouttemplate>
Expand|Select|Wrap|Line Numbers
- <script type=text/javascript>
- function myJavascriptFunction ( )
- {
- var myVar = document.getElementById("<%= TxtUser.ClientID%>").value ;
- ...code goes on
- }
- </script>
My code works fine if I remove the layouttemplate, it just seems that the "TxtUser" id is "hidden" by the layouttemplate.
Can anyone help me? Thanks in advance!