locked
How to use redirect to open link in new tab in asp.net core 2.0. RRS feed

  • Question

  • User966207163 posted

    Hi, I have a form on which submit I want to redirect to another page but I want to open the redirected page in a new tab.

    if (requestedDownloadLink != null) 

          return Redirect(requestedDownloadLink);

    Tuesday, May 26, 2020 12:37 PM

Answers

  • User966207163 posted

    HI, I was using a button to submit the form so that's why I could not use target="_blank" but after the post you shared i found that i can put target="_blank" on form and it open the link in new tab. thank you very much mgebhard.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 26, 2020 1:10 PM

All replies

  • User475983607 posted

    It's not possible to redirect to a new tab.  Use a link with the with the target set to "_blank" to open a new tab.

    https://www.w3schools.com/tags/att_a_target.asp

    Tuesday, May 26, 2020 12:40 PM
  • User966207163 posted

    HI, I was using a button to submit the form so that's why I could not use target="_blank" but after the post you shared i found that i can put target="_blank" on form and it open the link in new tab. thank you very much mgebhard.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 26, 2020 1:10 PM