0

I have this path for my application:

computername.com/Site1

I have a dropdown that when the value is changed, it should redirect the website to this:

computername.com/Site2

My problem here is that when I do this

string url = string.Format("computername.com/" + dropDownValue);
Response.Redirect(url);

I get redirected to computername.com/Site1/computername.com/Site2

What method can I do to achieve the behavior that I wanted?

Thanks!

Gerald
  • 933
  • 5
  • 18
  • 40

1 Answers1

1

Try:

string url = string.Format("http://computername.com/" + dropDownValue);
Response.Redirect(url);

That happens because your previously constructed URL recognized as relative rather than absolute.

Vladimirs
  • 7,800
  • 4
  • 39
  • 76