Asp.Net MVC: How to add information at the end of a page's url, in the browser

Viewed 25

I'm working on an asp.net mvc application and I need to modify the url that is in the browser, adding a "/something-more-here". The fact is that I have article content that is rendered on a page, but currently the url looks like this: https://localhost:44328/Blog/Article. And it needs to be like this: https://localhost:44328/Blog/Article/article-name. How can I do this url customization?

1 Answers

you can use this on html

<a href="/ControllerName/ActionMethodName">....</a>

You can also use this if you want to redirect via controller

return RediretToAction("ActionName","ControllerName");
Related