ASP.NET中弹出对话框的问题!!! 在网页里面怎样才能弹出一个模态的对话框呢??请高手指教!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是模式对话框吧?用javascript呀。 不知道什么叫:模态的对话框,lz没试过用javascript吗? 楼上的用javascript能够实现我上面所说的功能吗?应该怎么样实现,能告诉一下吗??或者有源码的话能共享一下吗??谢谢!!!! dele.Attributes.Add("onclick","return confirm('确定要添加您的信息吗???');");dele是你哪个button的idResponse.Write("<script>alert(\"文件格式不正确!!!\")</script>");这样也可以弹出一个来. To:baiyashan(依浪道夫) 这个我是知道的我的意思是说,弹出的对话框类似一个网页的,里面有datagrid之类的控件,然后在里面选择数据,请问怎么样实现吗? window.showModelDialog("Page.aspx","",""); showModalDialog() (Internet Explorer 4 和以上版本) showModelessDialog() (Internet Explorer 5 和以上版本) 用这个就可以实现你想要的功能~~e.g: <HTML> <HEAD> <TITLE>Change the URL</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function load() { win = window.showModalDialog("http://news.qq.com"); } // --> </SCRIPT> </HEAD> <BODY> <FORM> <INPUT TYPE="button" VALUE="Load" onClick="load()"></FORM> </BODY> </HTML> <script language="javascript">function aaa(idstr){window.open(idstr,"","toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=no,width=600,height=600,top=200,left=200");}</script><A onclick='"aaa(<%# DataBinder.Eval(Container.DataItem,"chanid","luyan.aspx?chanid={0}")%>)"' href="#">给我留言</A> onclick调用哪个函数.上面是弹出一个窗体,你哪个窗体上可以有认何东西.用<a>标记传一个参数,哪边一接就ok了.上面的代码都是在html里写的.是要这样的吗?? window.open 无法实现 而且在选择数据期间,不能对主页面进行操作的 lz的这个需求,所以还是要用 window.showModalDialog 同意 hzsasheng(无知少年 hzsasheng(无知少年) window.pen也可以的通过window.opener向其父窗口传值 Response.Write("<script language=javascript>alert('您还未登录,请登录!');</script>"); 看到12楼,我才知道楼主说的是什么 !模态对话框???? 我是菜鸟看不懂,不过我一直管window.showModalDialog 叫 模式窗体的。呵呵、 是不是这样的:先建一个用户控件,代码如下<asp:Literal ID="Literal1" runat="server" Text="提示信息"></asp:Literal>然后把控件引入其他网页,在其他网页直接调用此控件的id.ShowMessge("你想说的话"); showModelDialog或者window.open都可以。个人喜欢window.open。回父窗体数据可以用window.opener。 用window.opener可以实现你的主页面的一个按钮下面设置下onclick事件 window.open('aa.aspx')然后在aa.aspx提交的时候,写window.opener.父窗体的控件id.属性=。 try...主窗体<html><head></head><script>alert('aaa');function show(){ window.showModalDialog('test.html',window,'dialogHeight:400px;dialogWidth:54f0px;center:yes;help:no;resizable:no;status:no;scroll:no;'); window.location.reload();}</script><body><button onclick="show();">Test.html</button><br/></body></html>子窗体<html><head><base target="_self" /></head><body><h1>Welcome Test.html</h1><button onclick="window.close();">aaa</button></body></html> try... 带返回参数1. 要想对话框传递参数,是通过vArguments来进行传递的。类型不限制,对于字符串类型,最大为4096个字符。也可以传递对象,例如:-------------------------------parent.htm<script> var obj = new Object(); obj.name="51js"; window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");</script>modal.htm<script> var obj = window.dialogArguments alert("您传递的参数为:" + obj.name)</script>2. 可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如:------------------------------parent.htm<script> str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px"); alert(str);</script>modal.htm<script> window.returnValue="http://homepage.yesky.com";</script> 你想问的是一个层吧! 研读一下jquery 的Dialog吧 有很多样式 ,让你叹为观止 window.showModelDialog( "Page.aspx ", " ", " ");Google一下看看参数 怎么准确的获得主表最后一条记录的ID,然后赋给从表? 急!在线等!webPart目录模式声明性目录中图片无法显示? radio与数据库绑定的问题 Web.config配置用户的验证模式 DropDownList1取值的问题 关于ajax.net的问题 今天看到一种传值方式,请问大家这种是什么技术? 有没有画立体柱状图及立体饼图的例子? 关于多控件校验的问题 c#的sesssion和vb的session怎么公用??? 请问正则表达式中如何不区分大小写? 有ASP.NET揭秘(第二版)中文的版本的下载地址吗?
应该怎么样实现,能告诉一下吗??
或者有源码的话能共享一下吗??
谢谢!!!!
这个我是知道的
我的意思是说,弹出的对话框类似一个网页的,里面有datagrid之类的控件,然后在里面选择数据,请问怎么样实现吗?
e.g:
<HTML>
<HEAD>
<TITLE>Change the URL</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function load() {
win = window.showModalDialog("http://news.qq.com");
}
// -->
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Load" onClick="load()"></FORM>
</BODY>
</HTML>
function aaa(idstr)
{
window.open(idstr,"","toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=no,width=600,height=600,top=200,left=200");}
</script><A onclick='"aaa(<%# DataBinder.Eval(Container.DataItem,"chanid","luyan.aspx?chanid={0}")%>)"' href="#">给我留言</A> onclick调用哪个函数.上面是弹出一个窗体,你哪个窗体上可以有认何东西.用<a>标记传一个参数,哪边一接就ok了.上面的代码都是在html里写的.是要这样的吗??
先建一个用户控件,代码如下
<asp:Literal ID="Literal1" runat="server" Text="提示信息"></asp:Literal>然后把控件引入其他网页,在其他网页直接调用此控件的id.ShowMessge("你想说的话");
或者window.open都可以。个人喜欢window.open。回父窗体数据可以用window.opener。
你的主页面的一个按钮下面设置下onclick事件 window.open('aa.aspx')
然后在aa.aspx提交的时候,写window.opener.父窗体的控件id.属性=。
主窗体
<html>
<head></head>
<script>
alert('aaa');
function show()
{
window.showModalDialog('test.html',window,'dialogHeight:400px;dialogWidth:54f0px;center:yes;help:no;resizable:no;status:no;scroll:no;');
window.location.reload();
}
</script>
<body>
<button onclick="show();">Test.html</button><br/>
</body>
</html>子窗体
<html>
<head>
<base target="_self" />
</head>
<body>
<h1>Welcome Test.html</h1>
<button onclick="window.close();">aaa</button>
</body>
</html>
1. 要想对话框传递参数,是通过vArguments来进行传递的。类型不限制,对于字符串类型,最大为4096个字符。也可以传递对象,例如:
-------------------------------
parent.htm
<script>
var obj = new Object();
obj.name="51js";
window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
</script>
modal.htm
<script>
var obj = window.dialogArguments
alert("您传递的参数为:" + obj.name)
</script>2. 可以通过window.returnValue向打开对话框的窗口返回信息,当然也可以是对象。例如:
------------------------------
parent.htm
<script>
str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px");
alert(str);
</script>
modal.htm
<script>
window.returnValue="http://homepage.yesky.com";
</script>
Google一下看看参数