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

yuzhangqi發表於2010-08-02

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部落格 ” ,連結:http://blog.itpub.net/13651903/viewspace-1035884/,如需轉載,請註明出處,否則將追究法律責任。

相關文章