简体   繁体   中英

What's the Best Way to use Response.Redirect to for A Pop-Up in a .NET Web Application?

我正在尝试这样做,以防止最终用户浏览器安全功能(例如弹出窗口阻止程序)妨碍我的应用程序。

There is no way to disable pop-up blockers to prevent opening pop-ups.

Why do you want to use Response.Redirect? I find its best to inject javascript using this method:

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "PopUp", "window.open([url]);", true);

Another possibility is to use a modal dialog or floating iframe window to show other content on the current page. jQuery is great for this.

For example, check out jQuery impromptu if you're interested in simple messages/dialogs

jQuery Impromptu

"Use for a pop-up" how? You want the redirect to create the pop-up?

That can't be done. A redirect is a return status from the request made by a particular browser window. Responses don't create windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM