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".

3
  • 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. Commented Jan 21, 2019 at 23:52
  • Possible duplicate of aspx page to redirect to a new page Commented Jan 21, 2019 at 23:53
  • Take a look at how-to-ask so you have a higher chance of getting help and finding the answer to your question. Commented Jan 22, 2019 at 13:25

1 Answer 1

1

This code should do the trick.

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.