开发者

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%>"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜