Open a new page in new tab/window using link button

Posted by Kiranrs_13 under ASP.NET on 12/5/2011 | Points: 10 | Views : 41115 | Status : [Member] | Replies : 5
I want to open a page in new window / tab using link button .

!! Shri Swami Samarth !!


Responses

Posted by: Akiii on: 12/5/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,
Try this :-

<asp:LinkButton ID="LinkButton1" runat="server" target="_blank">LinkButton</asp:LinkButton>

Akiii

Kiranrs_13, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Varung on: 12/5/2011 [Member] Starter | Points: 25

Up
0
Down
write below statement in linkbutton click event
Response.Redirect("your url");

G.Varun

Kiranrs_13, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Arefin on: 12/6/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can try
<asp:LinkButton ID="LinkButton1" runat="server" target="_blank">LinkButton</asp:LinkButton>

@Varung: your code will not open in a different tab.

Thanks,
Arefin

Kiranrs_13, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksingh on: 12/6/2011 [Member] Starter | Points: 25

Up
0
Down
hi,

Try below code.

<asp:LinkButton runat="server" OnClientClick="javascript:window.open('MyPopup.aspx?','','left=250px, top=245px, width=700px, height=450px, scrollbars=no, status=no, resizable=no');return false;">testLink</asp:LinkButton>


Change your proper aspx page with MyPopup.aspx.
hope it will work out...

Regards,
Sunil

Kiranrs_13, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: muralikrishnasurap-12704 on: 12/6/2011 [Member] Starter | Points: 25

Up
0
Down
hi,
you can do this using javascript please check below code.

<script type="text/javascript">

function OpenNewWindow()
{
window.open("NewWindow.aspx", "List", "scrollbars=no,resizable=no,width=400,height=280");
return false;
}
</script>


 <asp:LinkButton ID="LinkButton1" OnClientClick="OpenNewWindow() ;" runat="server">LinkButton</asp:LinkButton>




Best Regards
Murali Krishna.S

Kiranrs_13, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response