articles

Home / DeveloperSection / Articles / Introduction to Open New Browser Window using C#.Net

Introduction to Open New Browser Window using C#.Net

Introduction to Open New Browser Window using C#.Net

mohan kumar 15368 02-May-2012

If you want to open new browser window then you can use this code.

<asp:Button ID="ButtonView" OnClick="ButtonView_Click" runat="server" Text="View" Width="80px" />

protected void ButtonView_Click(object sender, EventArgs e)
{
    string Fullurl = "newpage.aspx/";   
    OpenNewBrowserWindow(Fullurl, this);
}

 //This is used to open new browser window
public static void OpenNewBrowserWindow(string Url, Control control)
{
    ScriptManager.RegisterStartupScript(control, control.GetType(), "Open""window.open('" + Url + "');"true);
} 

 


Updated 26-Dec-2019
Having around 5 Years experience in .NET domain.

Leave Comment

Comments

Liked By