在网页里面怎样才能弹出一个模态的对话框呢??
请高手指教!!!

解决方案 »

  1.   

    是模式对话框吧?用javascript呀。
      

  2.   

    不知道什么叫:模态的对话框,lz没试过用javascript吗?
      

  3.   

    楼上的用javascript能够实现我上面所说的功能吗?
    应该怎么样实现,能告诉一下吗??
    或者有源码的话能共享一下吗??
    谢谢!!!!
      

  4.   

    dele.Attributes.Add("onclick","return confirm('确定要添加您的信息吗???');");dele是你哪个button的idResponse.Write("<script>alert(\"文件格式不正确!!!\")</script>");这样也可以弹出一个来.
      

  5.   

    To:baiyashan(依浪道夫) 
    这个我是知道的
    我的意思是说,弹出的对话框类似一个网页的,里面有datagrid之类的控件,然后在里面选择数据,请问怎么样实现吗?
      

  6.   

    window.showModelDialog("Page.aspx","","");
      

  7.   

    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> 
      

  8.   

    <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里写的.是要这样的吗??
      

  9.   

    window.open 无法实现 而且在选择数据期间,不能对主页面进行操作的 lz的这个需求,所以还是要用 window.showModalDialog
      

  10.   

    同意   hzsasheng(无知少年
      

  11.   

    hzsasheng(无知少年) window.pen也可以的通过window.opener向其父窗口传值
      

  12.   

                Response.Write("<script language=javascript>alert('您还未登录,请登录!');</script>");
      

  13.   

    看到12楼,我才知道楼主说的是什么 !模态对话框???? 我是菜鸟看不懂,不过我一直管window.showModalDialog 叫 模式窗体的。呵呵、
      

  14.   

    是不是这样的:
    先建一个用户控件,代码如下
    <asp:Literal ID="Literal1" runat="server" Text="提示信息"></asp:Literal>然后把控件引入其他网页,在其他网页直接调用此控件的id.ShowMessge("你想说的话");
      

  15.   

    showModelDialog
    或者window.open都可以。个人喜欢window.open。回父窗体数据可以用window.opener。
      

  16.   

    用window.opener可以实现
    你的主页面的一个按钮下面设置下onclick事件 window.open('aa.aspx')
    然后在aa.aspx提交的时候,写window.opener.父窗体的控件id.属性=。
      

  17.   

    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>
      

  18.   

    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>
      

  19.   

    你想问的是一个层吧! 研读一下jquery 的Dialog吧 有很多样式 ,让你叹为观止
      

  20.   

    window.showModelDialog( "Page.aspx ", " ", " ");
    Google一下看看参数