http://www.csdn.net/develop/Read_Article.asp?Id=15113
http://expert.csdn.net/Expert/topic/2001/2001793.xml?temp=.1702082
http://expert.csdn.net/Expert/topic/1911/1911975.xml?temp=.4667322
http://expert.csdn.net/Expert/topic/2001/2001793.xml?temp=.1702082
http://expert.csdn.net/Expert/topic/1911/1911975.xml?temp=.4667322
ParentPage.aspx:
window.showModalDialog("DialogPage.aspx?para1=aaa¶2=bbb");DialogPage.aspx:
string str1=Request.QueryString["para1"].toString();
string str2=Request.QueryString["para2"].toString();返回值
DialogPage.aspx:
window.returnValue="aaa";ParentPage.aspx:
var str=window.showModalDialog("DialogPage.aspx");
function test()
{
alert("d");
document.Form1.action="banzhu.aspx?sql=dd";
document.Form1.submit();
}
</SCRIPT>我执行这个客户端函数怎么也不行
他刷新啦。但是sql这个参数没穿过去。
function Button1_click()
{
var str=window.showModalDialog('Common_Query.aspx?tablename=researchtab');
if(str == undefined) return false;
document.Form1.TextBox1.value=str;
}在cs文件中的Button1的onclick事件执行方法中写根据TextBox1的值绑定数据的代码就可以了原理是这样的:
在点击Button1的时候,先执行Button1的前台onclick事件(执行Button1_click方法),弹出窗口,然后判断返回值是否为空,如果为空 return false;就不会执行其后台的方法(不回传);如果得到了值,就会回传来执行后台的方法,在后台的方法中去检索绑定数据。
你的方法是最好的,
接分!