【发布时间】:2009-03-19 21:12:46
【问题描述】:
我有以下 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>
我在记录用户的页面上有一个 asp:Button。这是我希望在服务器端单击按钮时发生的示例:
protected void LoginButton_OnClick(object sender, EventArgs e)
{
UserProfile profile = UserProfile.GetUserProfile(txtUserName.Text);
TimeSpan ts = profile.Expiration.Subtract(DateTime.Now);
if(ts.Days <= 30)
//call showJQueryDialog() to open the dialog box
Page.ClientScript.RegisterStartupScript(typeof(Login2), "showjquery",
"showJQueryDialog();", true);
else
//log the user in as normal.
}
我如何将如下方法附加到对话框上的更新按钮
public void Renew()
{
Response.Redirect("Renew.aspx");
}
【问题讨论】: