ASP.Net MVC 中的个性化——友好的 URL 和换肤
我还没有深入研究 ASP.Net MVC 中友好 URL 的自定义生成,并且想知道是否有人有建议。例如,如果 John Smith 要在 www.example.com 上创建一个帐户,我希望他的主页显示为 www.example.com/JohnSmith —— 以及让他选择 URL 的选项。理想的情况是在我不干预路线图的情况下实现这一点。
另外,是否有人有关于基于 URL 自定义 MVC 站点的好方法的指南?再次,使用 example.com,我希望 John 为其主页选择颜色主题和徽标,然后相应地应用它。
感谢您的提示和建议。
I haven't delved into custom generation of friendly URLs in ASP.Net MVC, and was wondering if anyone had suggestions. For example, if John Smith were to create an account on www.example.com, I'd like for his homepage to read www.example.com/JohnSmith -- along with the option for him to choose his URL. The ideal is for this to happen with no intervention on my part in the route maps.
Also, does anyone have guidelines on good ways to go to customize an MVC site based on URL? Again, using example.com I'd like for John to choose a color theme and logo for his homepage, then apply it accordingly.
Thanks for your tips and suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 路由 来实现此目的第二部分是它所在站点的关键。
这样该站点就成为每个操作都可用的变量。
You can use routing for this where the second part is a key to which site it is.
so that site becomes a variable available to every action.