Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
How to hit first oursite url then load destination url to newtab.
Ex:
url:www.destinationurl.com
when I click on above link first open newtab and hit my site url like www.mysiteurl.com then load destinationurl.

Please help me.
Thanks.
Posted
Updated 14-Jan-19 17:11pm
Comments
Nathan Minier 17-Nov-14 8:33am    
Have you tried just setting up a local redirect and sending your requests through it?
www.destinationurl.com/redirect?url=redirectTo
And put your redirect script there.
NagaRaju Pesarlanka 17-Nov-14 8:34am    
Thanks for replied me,
Please give one sample example.

on the click of button or any hyperlink

redirect to url http://ursite.com/redirect.aspx?url=http://fb.com


In the redirect.aspx page load write down the code

C#
protected void Page_Load(object sender, EventArgs e)
{
   if(Request.QueryString["url"]!=null)
   {
       Response.Redirect(Request.QueryString["url"].ToString());
   }
}


hope it will help you...
 
Share this answer
 
Comments
NagaRaju Pesarlanka 18-Nov-14 9:56am    
hiThanks to replied me.
How to do in MVC?
send as http://localhost:52489/Default1/index?url=codeproject.com
and in the action result write down the code...


C#
public ActionResult Index(string url)
{
    Response.Redirect("http://"+url);
    return View();
}



I think it will be okay for your problem.
 
Share this answer
 
v2

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