天天看点

showModalDialog回发后打开新页面

在asp.net页面中使用showModalDialog弹出模态页面,当弹出页面中有控件引起回发,就会又打开一个普通的showModalDialog指定的页面。

因dialog中,IE默认不允许post,提交时,它开了一个新的window来进行post,把数据传回server

解决方法:

在<head></head>标签内添加

<base target="_self">

* 网上资料中的解决办法:http://lcb530.javaeye.com/blog/231046

1、如果你是IE6,你将<base target="_self"/>加入到<head>标签里就可以了。

2、如果你是IE7,你必须将<base target="_self"/>加入到<head>的对中位置。

代码示例:

<html>

     <head>

           <title>test</title>

           <base target="_self"/>

           .............

     </head>

</html>

新的问题:

在装了.NET的客户机上没有问题,可在没有装.NET的客户机上执行时同样会弹出新的WEB窗体来进行POST

上面资料提到的问题未验证。

继续阅读