How to open page in new tab using the response. redirect at asp.net

后端 未结 8 2224
太阳男子
太阳男子 2021-01-03 23:42

I want to open a new tab or a new page by using Response.Redirect in a button click handler. I\'m using a query string to pass some values. How can I open he pa

8条回答
  •  青春惊慌失措
    2021-01-03 23:47

    You can use ScriptManager to do the needed:

    private void Redirect_New_Tab(string url_To_Open)
    {    
        string modified_URL = "window.open('" + url_To_Open + "', '_blank');";
        ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", modified_URL , true);
    }
    

提交回复
热议问题