代码如:
document.location.href = url + '?CurrentPage=' + txtPage.value ;实现文本框输入数字以后,跳动DataGrid制定的分页上去。确保地址正确,因为在“改变其URL的时候会打开一个新的普通页面“,这个页面正是分页后的正确页面。在模态窗口的头里面已经放有:
<base target='_self'>
在模态窗口里面点击按钮提交不会弹出新页面。
document.location.href = url + '?CurrentPage=' + txtPage.value ;实现文本框输入数字以后,跳动DataGrid制定的分页上去。确保地址正确,因为在“改变其URL的时候会打开一个新的普通页面“,这个页面正是分页后的正确页面。在模态窗口的头里面已经放有:
<base target='_self'>
在模态窗口里面点击按钮提交不会弹出新页面。
试试先!
WebForm1.aspx
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If (Not IsClientScriptBlockRegistered("clientScript")) Then
Dim strScript As String = "<script>" + vbCrLf
strScript += "function OpenWin(){" + vbCrLf
strScript += "var str=window.showModalDialog('WebForm2.aspx',document.Form1.TextBox1.value)" + vbCrLf
strScript += "if(str!=null) document.Form1.TextBox1.value=str" + vbCrLf
strScript += "}" + vbCrLf
strScript += "</script>" + vbCrLf
RegisterClientScriptBlock("clientScript", strScript)
End If
Button1.Attributes.Add("onclick", "OpenWin()")
End Sub
WebForm2.aspx
<frameset rows="0,*">
<frame src="about:blank">
<frame src="WebForm3.aspx">
</frameset>
WebForm3.aspx关键是webform2.aspx用框架页
是为了防止提交时打开新页面。
http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
xx.htm
====================
<frameset rows="0,*">
<frame src="about:blank">
<frame src="xxx.asp">
</frameset>
xxx.asp
=========
<form target="_self" method=post>