ITPub博客

首页 > 应用开发 > Java > prevent a Javascript Modal Window to open itself in a new window

prevent a Javascript Modal Window to open itself in a new window

原创 Java 作者:yuzhangqi 时间:2010-08-02 16:47:46 0 删除 编辑

I used window.showModalDialog() to open a modal window in my ASP.Net web application. When I click a Button control to do something, the page is postback, and this made the modal window reopen a new window for the page. This is not what I excpected.

To prevent this unexpected action, you need to add the following html code inside section of your ASP.NET page.

If your page use a master page, you should definde a ContentPlaceHolder under section in the Master page, and put the code above inside the placeholder of your aspx page.

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13651903/viewspace-1035884/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-06-10

  • 博文量
    102
  • 访问量
    763300