I want to do a Response.Redirect("MyPage.aspx")
but have it open in a new browser window. I've done this before without using the JavaScript register script method. I just can't remember how?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
If you can re-structure your code so that you do not need to postback, then you can use this code in the PreRender event of the button:
Contruct your url via click event handler:
Then:
You may want to use the Page.RegisterStartupScript to ensure that the javascript fires on page load.
You can use this as extension method
With this you get nice override on the actual Response object
You can also use the following code to open new page in new tab.
And just call Response.Redirect("yourPage.aspx"); behind button event.
I always use this code... Use this code