本文介绍了导航到路由的超链接的url属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在global.asax文件中创建了一条路线,如下所示:
i have created a route in the global.asax file like below :
routes.MapPageRoute("Selected Category", "{parent}/{child}", "~/Products.aspx");
之后我试图设置routeurl属性的超链接到路由网址。但它不是创建导航链接..它仍然是空的..应该是可能的原因..我在下面的代码做错了什么..任何帮助将不胜感激。
After that i am trying to set navigateurl property of hyperlink to the route url. But it is not creating navigation link.. It remains empty.. what should be the possible reason.. Am i doing something wrong in the below code.. Any help would be appreciated.
<asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl='<%# GetRouteUrl("Selected Category", new {parent = "Fashion" , child= "category1"}) %>'>Privacy Policy</asp:HyperLink>
推荐答案
NavigateUrl='<%= Page.GetRouteUrl("SelectedCategory", new RouteValueDictionary(new {parent = "Fashion" , child= "category1"})) %>'
希望您对此提示有所帮助。
Hope you will be helpful with this hints.
这篇关于导航到路由的超链接的url属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!