Question about adding event handler to a TextBox inside a TabContainer
I have a TabContainer on my page, and I want to add a keyup handler to the textbox, but somehow I counldn't find the textbox in my jquery function using $('#TabContainer1_TabPanel1_TextBox1').
How to fix my code to make it work? Here is my code:
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title></title>
- <script type="text/javascript" src="js/jquery-1.3.2.min.js" >
- $(document).ready(function(){
- $('#TabContainer1_TabPanel1_TextBox1').keyup(function(event){
- alert('Hello!');
- });
- });
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:ScriptManager ID="ScriptManager1" runat="server" />
- <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" AutoPostBack="false">
- <cc1:TabPanel runat="server" ID="TabPanel1">
- <ContentTemplate>
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
- </ContentTemplate>
- </cc1:TabPanel>
- </cc1:TabContainer>
- </div>
- </form>
- </body>
- </html>