使用 ASP.NET MVC Sitemap Provider 将页面的标题和站点地图节点设置为相同的文本
我正在使用 ASP.NET MVC 3
和 ASP.NET MVC Sitemap Provider
。我想将视图的标题和站点地图节点设置为相同的文本。我该怎么做?在哪里进行?有样品吗?
因此,如果我有以下链接 /Product/Create 那么我希望页面标题为 Capture New Product
。并且站点地图路径必须类似于 Home >产品>捕获新产品
。
如何在 NUnit 中为此编写测试?是否需要进行测试?
I'm using ASP.NET MVC 3
and ASP.NET MVC Sitemap Provider
. I would like to set the view's title and the sitemap node to the same text. How would I do this? Where would it be done and are there any samples?
So if I have the following link /Product/Create then I would like the page title to be Capture New Product
. And the sitemap trail must look like Home > Product > Capture New Product
.
How would one write tests for this in NUnit? Are tests necessary?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将视图的标题设置为 SiteMap.CurrentNode.Title。这应该可以解决问题。
Set the view's title to SiteMap.CurrentNode.Title. This should do the trick.