Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to open a pop up window on a new window on click on a hyperlink using asp .net c#

What I have tried:

HyperLink hyp_Channel_Value = new HyperLink();
                    hyp_Channel_Value.ID = "hyp_Channel_Value" + l;
                    hyp_Channel_Value.CssClass = "Owner_Link";
                    hyp_Channel_Value.Target = "blank";
                    string url = "test.aspx";
                    hyp_Channel_Value.NavigateUrl = url;
                    hyp_Channel_Value.Attributes.Add("onclick", "window.open(" + url + ");return false");
Posted
Updated 13-Aug-18 2:47am

1 solution

We can do this by using Link button

LinkButton lnk = new LinkButton();
lnk.OnClientClick = "javascript:window.open('https://www.codeproject.com','CodeProject', 'scrollbars=yes, width=300, height=300, top=100, left=100')";

lnk.Text = "Code Project";
this.panel.Controls.Add(lnk);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900