Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want open new link in new tab in the browser via this code server.transfer or response.redirect how?
i don't want use javascript for this probleem please help me.
THANKS.
Posted

You need to register the script from the code behind to achieve this task, try using the following code instead of response.redirect or server.transfer

C#
ClientScript.RegisterClientScriptBlock(this.GetType(), "redirect", "window.open('mypopuppage.html')", true);


hope this will help you achieving the goal :)
 
Share this answer
 
Comments
[no name] 16-Dec-12 7:31am    
No js...
Behnam Mohammadi 16-Dec-12 17:18pm    
no by this solution the browser maybe block pop up windows i want open in new tab via pure c# or asp.net code
thanks
please help if you know
Behnam Mohammadi 17-Dec-12 1:00am    
I don't unsderstand please write code in complate form.
thanks
Try this :
C#
HyperLink1.NavigateUrl = "blah_blah.aspx";
HyperLink1.Target = "blank";
 
Share this answer
 
Hi, Please Try This code. It works Perfectly..

Response.Write("window.open('YourPageName.aspx','_blank');");
 
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