I have a funny situation with a jquery selector, trying to find something within an asp.net LoginView:
Say I have 4 controls, 2 plain html <input>s, and 2 <asp:TextBox>es. One of each inside an <asp:Loginview>.
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
<input type="text" id="htmlInput1" />
<asp:TextBox id="aspTextbox1" runat="server"></asp:TextBox>
</LoggedInTemplate>
</asp:LoginView>
<input type="text" id="htmlInput2" />
<asp:TextBox id="aspTextbox2" runat="server"></asp:TextBox>
Then let's say I want to apply some jquery to each of them. Guess which one of these 4 does not work?
<script>
$(function () {
$("#htmlInput1").datepicker();
$("#htmlInput2").datepicker();
$("#aspTextbox1").datepicker();
$("#aspTextbox2").datepicker();
});
</script>
For some reason, the asp.net textbox within the LoginView is not reached. Do I have to somehow select the LoginView first?
var x = $("LoginView1").....