SEO 友好路由 2 个查询字符串
我第一次尝试 SEO 友好路由并想传递 2 个查询字符串。
基本路由是www.SiteName.com/brandName,我这样做是
void RegisterRoutes(RouteCollection Routes)
{
Routes.MapPageRoute("Brands", "Brands/{brand}", "~/Brand.aspx");
}
为了创建一个产品页面,我想传递两个查询字符串,即 www.SiteName.com/brandName/ProductName
为此,我将此行添加到我的路线集合
Routes.MapPageRoute("Phones", "{*brand}/{*ProdName}", "~/ProdName.aspx");
问题: 产品页面的 SEO 友好路由工作正常,但当我尝试调试时它总是出错......如果我停止调试,它就会再次开始工作。
谁能告诉我如何解决这个问题?
I am trying SEO Friendly Routing first time and wanted to pass 2 query strings.
Basic Routing was www.SiteName.com/brandName which i did like this
void RegisterRoutes(RouteCollection Routes)
{
Routes.MapPageRoute("Brands", "Brands/{brand}", "~/Brand.aspx");
}
To create a Product page i wanted to pass two query strings i.e.
www.SiteName.com/brandName/ProductName
To do so i added this line to my Route Collection
Routes.MapPageRoute("Phones", "{*brand}/{*ProdName}", "~/ProdName.aspx");
PROBLEM:
The SEO Friendly Routing for product page is working fine but it always give an error when i try to debug .... if I stop debugging then it starts to work again.
Can anyone please tell me how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我点击了 msdn 链接,但找不到我做错了什么。
Global.asax
Product.aspx.cs
调试中的错误(Visual Web Dev.2010):
你调用的对象是空的
I followed the msdn link and cant find what i did wrong.
Global.asax
Product.aspx.cs
ERROR in Debugging (Visual Web Dev.2010):
Object Reference not set to an instance of an object