using (DataServer server = new DataServer())
{
server.ExecuteNonQuery(CommandType.Text, updateuser, param);
}
MessageBox.Show("User succesfully updated");
当字段更新时,我有一个更新按钮,我显示一个消息框,但问题是消息框位于浏览器后面。我必须最小化浏览器才能关闭消息框,同时我能够在不关闭消息框的情况下在网站中导航,我想在显示消息框时模糊网站中的剩余区域。我怎样才能在我的网站上做到这一点。
<小时/>最佳答案
在这种情况下,您要么想用 JavaScript 发出警报,要么使用某种对话框。
要发出警报,您可以执行以下操作:
Page.ClientScript.RegisterStartupScript(GetType(), "UserDialogScript", "alert(\"User successfully updated\");", true);
至于使用对话框,我建议使用ModalPopupExtender
或jQuery UI Dialog
。
ModalPopupExtender:
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/modalpopup/modalpopup.aspx
jQuery UI 对话框:
http://jqueryui.com/demos/dialog/
关于c# - asp.net 网站中的消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7576307/