简体   繁体   中英

How to make MVC URL always “www.domainname.com”?

I seem to remember in an MVC training class I took that you could hide the {controller}/{action}/{parameter} from the user, so they could only see the site domain...

Do you know if this is possible? How to do it? Or keywords that I could search further on?

I basically have buttons on each View of my project that are Back/Next, these buttons in their javascript file are basically: window.href("pageToGoto"), I would still want this functionality to exist, but I don't want the user to see the pages in the URL.

Thanks for any advice.

You could use MVC and make a single page application (SPA). SPA Tutorial links a tutorial that shows how to make such an application using ASP.net web api and angular.js.

Keep in mind thought, SPA's are not great for bookmarking, SEO, etc. as mentioned in an above comment so I'd think about it and make sure this is really the design pattern you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM