RoutingExpressionBuilder Dynamic Parameters
Using routing in web forms in ASP.NET 4.0. Looking to use dynamic parameters in the RoutingExpressionBuilder class something like:
NavigateUrl="<%$ RouteUrl:searchterm={dynamicParameterFromObject} %>">
Would like to know the proper syntax is availa开发者_运维百科ble.
cheers
Hard to do with the <%$ syntax.
This alternative should work.
<%
String routeName= "<<routeName>>";
String controllerName= "<<controllerName>>";
String actionName="<<action>>";
String url=GetRouteUrl(routeName, new { Controller = controllerName, Action=actionName });
%>
...
NavigateUrl="<%=url%>"
精彩评论