[英]message box window using asp.net and c#
I am trying to accomplish the following in my website: 我正在尝试在我的网站上实现以下目标:
There is a "Message User" button, when it is clicked I want to display a Message box to the user and have the following requirement: 有一个“消息用户”按钮,单击该按钮后,我想向用户显示消息框,并具有以下要求:
I have seen this on other sites. 我在其他网站上看到过。
Is this accomplished using AJAX? 这是使用AJAX完成的吗?
It is accomplished by using javascript - typically it's a hidden div on the page that is tied to the click event of your button - there are TONS of controls out there to do this (called dialog boxes) see: 这是通过使用javascript完成的-通常是页面上的隐藏div与按钮的click事件相关联-那里有大量的控件可以用来执行此操作(称为对话框),请参见:
You could also use the Ajax Control Toolkit 您还可以使用Ajax Control Toolkit
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx
you can use on button click if displaying message box using Ajax as: 如果使用Ajax显示消息框,则可以单击按钮使用:
string jv = "alert('Error Details: Duplicate Entry of Company Name ');"; 字符串jv =“ alert('错误详细信息:公司名称')的重复输入;”; ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", jv, false);
ScriptManager.RegisterClientScriptBlock(this,typeof(Page),“ alert”,jv,false); return;
返回;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.