用JS脚本:alert("你的字符串"),这个是我的一个函数: public void MsgBox( Page _Page, string _Msg )
{
StringBuilder StrScript = new StringBuilder();
StrScript.Append( "<script language=javascript>" );
StrScript.Append( "alert('"+ _Msg +"');" );
StrScript.Append( "</script>" );
_Page.RegisterStartupScript( "MsgBox", StrScript.ToString() );
}
{
StringBuilder StrScript = new StringBuilder();
StrScript.Append( "<script language=javascript>" );
StrScript.Append( "alert('"+ _Msg +"');" );
StrScript.Append( "</script>" );
_Page.RegisterStartupScript( "MsgBox", StrScript.ToString() );
}
解决方案 »
- AspNetPager 分页控件的问题
- 怎么试用QueryString
- 请问怎么在分页中加入分页跳转
- 如何提取动网论坛的帖子标题到网站首页上显示
- 看水晶报表如何用!异常详细信息: CrystalDecisions.CrystalReports.Engine.LogOnException: 登录失败。
- 求购Asp.Net空间
- 为什么不能给.ascx中属性赋值?
- 广州 高科大厦 创业团队 找合作伙伴
- 在頁面中加入單獨的Javascript文件為什麼不能執行?
- 大家如果开发的asp.net 程序不是 CODEBEHIND 时,使用什么编辑器?
- 已有邮件服务器,怎样做出像163,263一样的邮件系统(asp.net c#)
- (在线等待)freetextbox在显示文本时,有时会出现,某行只显示字体下一半截(1/5左右)
string url="viewfu.aspx?id="+Id;
Response.Write("ChildWindow = window.open('"+url+"', '111', 'width=400,height=300,top=150,left=200,toolbar=no,status=yes,location=no,menubar=no,directories=no,scrollbars=yes,resizable=no')");
Response.Write("</script>");
Button1.Attributes["onclick"]="javascript:if(window.confirm('是or否?')){return true;}else{return false;}";
Overloads Public Shared Function Show( _
ByVal owner As IWin32Window, _
ByVal text As String, _
ByVal caption As String, _
ByVal buttons As MessageBoxButtons, _
ByVal icon As MessageBoxIcon, _
ByVal defaultButton As MessageBoxDefaultButton, _
ByVal options As MessageBoxOptions _
) As DialogResult参数:
owner
IWin32Window,消息框将显示在其前面。
text
要在消息框中显示的文本。
caption
要在消息框的标题栏中显示的文本。
buttons
MessageBoxButtons 值之一,它指定在消息框中显示哪些按钮。
icon
MessageBoxIcon 值之一,它指定在消息框中显示哪个图标。
defaultButton
MessageBoxDefaultButton 值之一,它指定消息框的默认按钮。
options
MessageBoxOptions 值之一,它指定将用于消息框的显示和关联选项。注意:
MessageBoxOptions 值要选择Windows.Forms.MessageBoxOptions.ServiceNotification,否则会报错。
你有没有试过,你写的代码是在客户端执行的吗?
我也是用的System.Window.Form的消息框,可是全部都是在服务器端执行的,客户端的确认过程,现在反而到了服务器端~!
所以,用消息框还是用客户端脚本语言来实现的好~!
============
系统自动完成返回。因为这种对话框很简单,不是很复杂。就是除了[确定],就是[取消]了,别的还没有遇到过。