【发布时间】:2010-10-14 14:56:49
【问题描述】:
我有一个带有登录控件的母版页。单击登录按钮时,如果用户的会员资格将在 30 天内到期,我希望弹出一个 JQuery 对话框,否则它将正常登录。我不知道该怎么做。我将发布部分代码:
这里是javascript:
<script type="text/javascript">
function showjQueryDialog() {
$("#dialog").dialog("open");
}
$(document).ready(function() {
$("#dialog").dialog({
autoOpen: false,
modal: true,
buttons: { "Renew Membership": function()
{ $(this).dialog("close"); } }
});
});
</script>
登录按钮称为 ibtnLoginButton,下面是部分代码:
//Grab the user profile.
UserProfiles userProfile =
UserProfiles.GetUserProfiles(txtUserName1.Text);
//Calculate the Time Span
TimeSpan timeSpan = userProfile.Expiration.Subtract(DateTime.Now);
if (timeSpan.Days < 30)
{
//Show JQuery Dialog Here
}
else
{
//Continue with Login Process.
}
【问题讨论】:
标签: c# asp.net jquery jquery-ui