jQuery dialog with asp:login control in c#
Hi everybody,
thanks for reading my post and giving me some time.
I would like to put an asp:login in a jquery dialog, thing that i've done but now I would like to treat the button login event but it doesn't work.
This is my website :
http://onceuponatimejohanna.com/ hopefully after I will be able to do the same for the register dialog.
THANKS A LOT
and this is my script :
- $("documemt").ready(function () {
var dlg = $('#divMyDialog').dialog({
autoOpen: false,
modal: true,
width: 400,
resizable: false,
overlay: {
background: "black",
opacity: 0.5
},
buttons: {
'Login': function () {
$('#<%= login1.FindControl("LoginButton").ClientID %>').click();
},
Cancel: function () {
$(this).dialog('close');
}
}
});
dlg.parent().appendTo(jQuery('form:first'));
$('#create-user').click(function () {
$('#divMyDialog').dialog('open');
})
})
I've added the button in my usercontrol : userinfo.asx
- <button id="create-user" class="ui-button ui-state-default ui-corner-all" onclick="return false;">Login</button>
Otherwise this is my dialog code :
- <div id="divMyDialog" title="Login">
<p id="validateTips">
Please enter your login.</p>
<asp:Login ID="login1" runat="server" meta:resourcekey="loginResource1">
<LayoutTemplate>
<table border="0" cellpadding="1">
<tr class="UserInfoText">
<td>
<table border="0" cellpadding="0">
<tr>
<td align="right">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" meta:resourcekey="UserNameLabelResource1">User Name:</asp:Label>
</td>
<td>
<asp:TextBox ID="UserName" runat="server" meta:resourcekey="UserNameResource1"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1"
meta:resourcekey="UserNameRequiredResource1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" meta:resourcekey="PasswordLabelResource1">Password:</asp:Label>
</td>
<td>
<asp:TextBox ID="Password" runat="server" TextMode="Password" meta:resourcekey="PasswordResource1"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1"
meta:resourcekey="PasswordRequiredResource1">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td colspan="2">
<asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." meta:resourcekey="RememberMeResource1" />
</td>
</tr>
<tr>
<td align="center" colspan="2" style="color: red">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False" meta:resourcekey="FailureTextResource1"></asp:Literal>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In"
ValidationGroup="Login1" meta:resourcekey="LoginButtonResource1" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</LayoutTemplate>
</asp:Login>
</div>