CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  ASP.NET

如何做一个PICKUP工能

楼主gdutmo(莫一冰)2003-11-02 07:45:59 在 .NET技术 / ASP.NET 提问

我现在要做一个PICKUP工能(弹出一个模式窗体,取其中的控件的返回值)。  
  我用JAVASCRIPT打开showModalDialog,并用RETRUNVALUE返回值,但现在的问题是只我点一下showModalDialog中的控件就会出现一个新页,并不会关闭自身,应如何解决。小弟急于解决此问题,在线等。望各位高手救命啊。 问题点数:0、回复次数:9Top

1 楼saucer(思归)回复于 2003-11-02 07:54:04 得分 0

use   a   iframe/frameset   in   the   pages   in   opened   by   showModalDialog   and   host   the   page   there  
   
  Or  
  add   this   line   to   those   pages  
  <base   target="_self">  
  Top

2 楼gdutmo(莫一冰)回复于 2003-11-02 09:24:45 得分 0

思归大哥我在页面这样定义   <body   MS_POSITIONING="GridLayout"   id="MyBody"   runat="server">   但在ASPX中不能使用MyBody的,我已经引用了Imports   System.Web.UI.HtmlControls  
  Top

3 楼saucer(思归)回复于 2003-11-02 09:39:10 得分 0

not   "body",   it   is   "base"  
   
  <base   target="_self">  
  <body   MS_POSITIONING="GridLayout"   id="MyBody"   runat="server">  
   
  code-behind:  
  protected     MyBody   as   HtmlGenericControlTop

4 楼gdutmo(莫一冰)回复于 2003-11-02 18:26:04 得分 0

思归,那我如何可以传值给那个子窗体呢?因为它是HTML,这可使我头痛Top

5 楼rgbcn(奔向.net)回复于 2003-11-02 19:43:09 得分 0

可以传值   
   
  http://msdn.microsoft.com/library/en-us/dnwebteam/html/Webteam06032002.asp?frame=trueTop

6 楼rgbcn(奔向.net)回复于 2003-11-02 19:44:19 得分 0

In   the   following   sample,   we   illustrate   passing   an   array   of   parameters   containing   two   strings   and   an   array   to   the   modal   dialog   box.  
   
   
   
   
  main.htm:  
   
  <html><head>  
  <style>  
  body   {   font-family:   comic   sans   MS   ;   font-size:   10pt   }  
  .maroon   {   color:   maroon   }  
  </style>  
  <script   language="vbscript">  
  Sub   doit_onclick  
        Dim   something(2)  
        something(1)   =   "x"  
        something(0)   =   "z"  
        something(2)   =   "y"  
   
        retval   =   window.showModalDialog   (_  
        "dialog.htm",_  
        Array(iName.value,iColor(iColor.selectedIndex).value,something),_  
        "dialogWidth:20;   dialogHeight:20")  
   
        If   IsArray(retval)   Then  
              iName.value   =   retval(1)  
        Else  
              iName.value   =   retval  
        End   If  
   
  End   Sub  
  </script>  
  </head>  
  <body   bgcolor="lightyellow"   text="darkgreen">  
  <center>  
  <br><br><br><br>  
  <span   class="maroon"><font   size="+1">A   Modal   Window   Example!</font></span><br>  
  <br><br><br><br>  
  Please   enter   your   name:<br>  
  <input   type="text"   id="iName"   value="Kalle   Anka"   size=15><br>  
  <br>  
  Pick   a   colour:<br>  
  <select   id="iColor">  
        <option   value="dodgerblue">blue</option>  
        <option   value="red">red</option>  
        <option   value="gold">gold</option>  
  </select>  
  <br>  
  <br>  
  and   click!<br>  
  <input   type="button"   id="doit"   value="show   me">  
  <br>  
  </center></body></html>  
   
   
   
   
   
  dialog.htm:  
  <html><head>  
  <title>The   focus   is   all   mine!</title>  
  <script   language=vbscript>  
  Sub   doneit_onclick()  
        returnValue   =   Array("Yahoo!",   uname.value)  
        window.close  
  End   Sub  
  </script>  
  </head>  
  <body>  
  <b>Please   change   your   details   below:</b><br>  
  <script   language="vbscript">  
        If   IsArray(window.dialogArguments)   Then  
            inarr   =   window.dialogArguments  
            document.bgcolor   =   inarr(1)  
   
            document.writeln   "<select>"  
            For   Each   param   In   inarr(2)  
                        document.writeln   "<option   value="""   &   param   &     """>   "   &   param  
            Next  
            document.writeln   "</select>"  
   
            document.writeln   "<input   name=uname   value="""   &   inarr(0)   &   """><br>"  
        End   If  
  </script>  
  <input   type="button"   value="All   Done"   onclick="doneit_onclick">  
  <br><br>  
  </body>  
  </html>  
   
   
   
  Top

7 楼gdutmo(莫一冰)回复于 2003-11-03 19:42:39 得分 0

如果showModalDialog中只有一个页就可以传值,但是只我点页面中的按扭就会多弹出一个窗口,并不能关闭自身。我才用的方法是用框架,但这样我应在那里取值呢,请高手指点。Top

8 楼gdutmo(莫一冰)回复于 2003-11-03 20:09:42 得分 0

HELP   ME   我急于解决此问题。请各位指教啊Top

9 楼gdutmo(莫一冰)回复于 2003-11-04 02:58:09 得分 0

思归,老孟、   rgbcn(cody)等高手有办法吗?Top

相关问题

  • 该如何做以下工作,please see it
  • 如何做停靠工具条
  • 在DELPHI,如何做工具栏?
  • 如何做大图标的工具栏?
  • 如何做平板工具栏?
  • 如何做好配置管理工作?
  • 如何做工作流程优化?
  • 在VB中如何做出工具栏!
  • 如何找工作?
  • 工具栏(JToolBar)如何做跟Jbuilder工具栏一样的按纽效果?

关键词

得分解答快速导航

  • 帖主:gdutmo

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo