如何做一个PICKUP工能
我现在要做一个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




