0

Let's say I'm currently on www.tacos.com/happy/burritos, which is defined under my controller as [RoutePrefix("{mood}/{food}'.

I'm trying to use an asp.net function(maybe something like @Url.route()) to change it to www.tacos.com/sad/burritos by setting mood = "sad".

Stamos
  • 3,938
  • 1
  • 22
  • 48
Gooby
  • 621
  • 2
  • 11
  • 32
  • Your question is too broad... fundamentally, the way web works is that browser sends a request and server replies with a response. Now if you want to change the URL (which is one and the same thing as a request) you would need to send a new request to the server. – Hooman Bahreini Jan 21 '19 at 23:52
  • Possible duplicate of [aspx page to redirect to a new page](https://stackoverflow.com/questions/1093081/aspx-page-to-redirect-to-a-new-page) – Word Rearranger Jan 21 '19 at 23:53
  • Take a look at [how-to-ask](https://stackoverflow.com/help/how-to-ask) so you have a higher chance of getting help and finding the answer to your question. – MaxW Jan 22 '19 at 13:25

1 Answers1

1

This code should do the trick.

Response.Redirect("www.tacos.com/sad/burritos");

Based on aspx-page-to-redirect-to-a-new-page

Word Rearranger
  • 1,306
  • 1
  • 16
  • 25