locked
open a newtab with Url.Action in Datatable RRS feed

  • Question

  • User916680651 posted

    I would like to try to open with a new window(or tab) with the parameters. the Source is down below.

    <script>

    var apiInfo = { aoColumns: [ { sTitle: "Test_CODE", mData: "CODE", sClass: "dt-body-center", link: { url: "@Url.Action("Method", "Action"}", parameter: ["ID"] } } ] }

    </script>

    I can page transition in the same tab, but couldn't open in a new tab

    Thanks.

    <script></script>

    Tuesday, February 18, 2020 2:46 AM

All replies

  • User-474980206 posted

    That’s just a simple object, and is not the code. If the code that uses this object supports link targets, then set the target. 

    Tuesday, February 18, 2020 4:00 AM
  • User1535942433 posted

    Hi,HW L,

    Accoding to your description,I suggest you could look the different of html.actionlink() and url.action().And you need to add target="_blank".

    More details,you could refer to below article:

    https://exceptionshub.com/how-to-have-a-a-razor-action-link-open-in-a-new-tab.html

    Best regards,

    Yijing Sun

    Tuesday, February 18, 2020 10:05 AM