简体   繁体   中英

How to Open Datalist Link Button in New Tab in browser

I have a DataList which has some LinkButtons which redirects to another page with QueryString . On click, it is redirecting to the other page with QueryString .

If I right click on the LinkButton inside the DataList and try to open in new tab, only a blank page is opening.

Guys, if you have some solution regarding this please help me!

private void linkbutton_Click(object sender, EventArgs e)
{
    var link = sender as LinkButton;
    string url = link.Link;
    Process.Start(url);
}

Try this. The problem may be that you are unable to supply the url for process in your code.

You can try this code

<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click"
  onclientclick=" window.open(&quot;~/Login.aspx&quot;, &quot;List&quot;, &quot;scrollbars=no,resizable=no,width=400,height=280&quot;)">LinkButton</asp:LinkButton>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM