locked
I want to open this url in the same tab. RRS feed

  • Question

  • User-1651858287 posted

    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert(' You will be redirected to the Portal.'); window.open('http://www.newurl.com/');", true);

    It opens in a new tab. 

    I want the same tab. 

    Thanks.

    Monday, March 15, 2021 3:03 PM

All replies

  • User-775646050 posted

    Simply change window.open with window.location.replace and your redirect should stay in the same tab.

    Monday, March 15, 2021 3:52 PM
  • User753101303 posted

    Hi,

    Not directly related but another popullar option is to have an icon following the link or the button (seems to happen after a postback ?) which give the information without having to close an additonal message.

    For example at https://docs.microsoft.com/en-us/dotnet/core/introduction, "Mobile apps" and "Games" are followed by an "external" icon.

    Monday, March 15, 2021 4:37 PM
  • User-1651858287 posted

    Thanks

    Monday, March 15, 2021 4:43 PM