Use the HyperLinkFiled instead of LinkButton and set its Target property as needed.
how to code classic asp.net to open multiple browser instances (pages)
Coreysan
1,671
Reputation points
I am working with .Net 4.0, where a user can see records in a GridView. What Im after is this:
- User has access to the Gridview on the main page.
- He clicks on a linkbutton from the gridview that launchers another browser instance (page 2).
- He clicks on yet another linkbutton from the gridview that launches another browser instance (page 3).
- Now that there are 3 browser instances, he can minimize, resize, etc. to compare all the details from pages 2 and 3, for example.
Can that be done with v4.0, with as little javascript as possible?
2 answers
Sort by: Most helpful
-
-
Lan Huang-MSFT 29,166 Reputation points Microsoft Vendor
2024-08-29T06:41:47.44+00:00 Hi @Coreysan,
You can try the code below.
<asp:TemplateField> <ItemTemplate> <asp:LinkButton Text="view1" ID="lnkView1" runat="server" OnClientClick="multiopen1()" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:LinkButton Text="view2" ID="lnkView2" runat="server" OnClientClick="multiopen2()" /> </ItemTemplate> </asp:TemplateField>
<script type="text/javascript"> function multiopen1() { window.open('WebForm2.aspx', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes'); } function multiopen2() { window.open('WebForm3.aspx', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes'); } </script>
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread