[英]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... 我似乎记得在一次MVC培训班中,我参加过一次培训,您可以向用户隐藏{controller} / {action} / {parameter},因此他们只能看到站点域...
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. 我基本上在项目的每个视图上都有“后退/下一步”按钮,它们的javascript文件中的这些按钮基本上是:window.href(“ pageToGoto”),我仍然希望此功能存在,但是我不希望用户以查看URL中的页面。
Thanks for any advice. 感谢您的任何建议。
You could use MVC and make a single page application (SPA). 您可以使用MVC并制作一个单页应用程序(SPA)。 SPA Tutorial links a tutorial that shows how to make such an application using ASP.net web api and angular.js.
SPA教程链接了一个教程,该教程显示了如何使用ASP.net Web API和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. 请记住,如上面的评论中所述,SPA不适用于书签,SEO等,因此我会考虑一下,并确保这确实是您需要的设计模式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.