System.Web.UI.Control.GetRouteUrl C# (CSharp) Method

GetRouteUrl() public method

public GetRouteUrl ( RouteValueDictionary routeParameters ) : string
routeParameters RouteValueDictionary
return string
		public string GetRouteUrl (RouteValueDictionary routeParameters)
		{
			return GetRouteUrl (null, routeParameters);
		}

Same methods

Control::GetRouteUrl ( object routeParameters ) : string
Control::GetRouteUrl ( string routeName, RouteValueDictionary routeParameters ) : string
Control::GetRouteUrl ( string routeName, object routeParameters ) : string

Usage Example

        // Format will be <%$ ExpPrefix: RouteName = <name>, Key=Value, Key2=Value2 %>
        public static string GetRouteUrl(Control control, string expression) {
            if (control == null) {
                throw new ArgumentNullException("control");
            }

            string routeName = null;
            RouteValueDictionary routeParams = new RouteValueDictionary();
            if (TryParseRouteExpression(expression, routeParams, out routeName)) {
                return control.GetRouteUrl(routeName, routeParams);
            }
            else {
                throw new InvalidOperationException(SR.GetString(SR.RouteUrlExpression_InvalidExpression));
            }
        }
All Usage Examples Of System.Web.UI.Control::GetRouteUrl