2

In a mvc project that we have developed for 6 months to now, we don't want to change the url when redirecting to another view. For example, our domain is xyz.net, we want customers to see only our domain name in url. Is it possible? Can we do it with mvc routing?

When we use return View("ViewName"), url is not changing. Is it meaningful to use for all in project for not changing url?

Now project contains RedirectToAction("ViewName", "ControllerName") for redirection between views, and it is changing url like "xyz.net/controllername/viewname".

How can we do without using url routing?

ridvandev
  • 51
  • 1
  • 1
  • 6
  • 3
    While you can use `RedirectToAction("Root action")` in all your actions, I believe you want a [single page application](https://msdn.microsoft.com/en-us/magazine/dn463786.aspx). – GSerg Aug 02 '15 at 19:11
  • @GSerg is there a way to do this without a js framework? Example in the link you sent is using knockout.js. Do we have to use it or something other? – ridvandev Aug 04 '15 at 08:36
  • You certainly can [send ajax requests](http://stackoverflow.com/q/8567114/11683) and [update DOM](http://stackoverflow.com/q/4724830/11683) only using pure javascript, but you will soon realize you're writing the same boilerplate code over and over again. You might then refactor all this code into a separate boilerplate-code js file, at which point you are back to using a js framework - it's just that you wrote this one yourself. – GSerg Aug 04 '15 at 09:01
  • @GSerg thanks for help. we have idea about the solution now. – ridvandev Aug 05 '15 at 10:37

0 Answers0