I'm new at Jquery and im trying to display a div on the LinkButton ClickEvent (If I use a button instead of a linkbutton it will work)
This is my Jquery code
<script type="text/javascript">
$(document).ready(function () {
$('#<%=lbLog.ClientID%>').click(function () {
$("#login").show(2000);
alert("hello");
});
});
</script>
The hello message is displayed by not the div
and this is my html code:
<asp:LinkButton ID="lbLog" runat="server" onclick="lbLog_Click">Login</asp:LinkButton>
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
<div id="login" style="display:none">
Username: <asp:TextBox ID="txtUsername" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvUsername" runat="server" ControlToValidate="txtUsername" Display="Dynamic" ErrorMessage="*" ValidationGroup="LogGroup">*</asp:RequiredFieldValidator>
Password: <asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="rfvPassword" runat="server" ControlToValidate="txtPassword" Display="Dynamic" ErrorMessage="*" ValidationGroup="LogGroup">*</asp:RequiredFieldValidator>
<asp:Button ID="btnLog" runat="server" Text="Login" onclick="btnLog_Click" ValidationGroup="LogGroup" />
</div>