1.LinkExtensions类
该类主要用于生成相关链接,主要扩展了ActionLink和RouteLink方法
2.ActionLink
ActionLink扩展方法主要实现一个连接,共有十个重载方法
ActionLink(string linkText,string actionName);
ActionLink(string linkText,string actionName,object routeValues);
ActionLink(string linkText,string actionName,object routeValues,object htmlAttributes);
ActionLink(string linkText,string actionName,RouteDictionary routeValues);
ActionLink(string linkText,string actionName,RouteDictionary routeValues,
IDictionary<string,object> htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName);
ActionLink(string linkText,string actionName,string controllerName,object routeValues,
object htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName,RouteDictionary routeValues,
IDictionary<string,object> htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName,string protocol,string hostName,
string fragment,object routeValues,object htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName,string protocol,string hostName,
string fragment,RouteValueDictionary routeValues,IDictionary<string,object> htmlAttributes);
2.RouteLink
RouteLink(string linkText,string routeName,object routeValues);
RouteLink(string linkText,string routeName,RouteValueDictionary routeValues);
RouteLink(string linkText,string routeName,object htmlAttributes);
RouteLink(string linkText,RouteValueDictionary routeValues,IDictionary<string,object> htmlAttributes);
RouteLink(string linkText,string routeName,object routeValues,object htmlAttributes);
RouteLink(string linkText,string routeName,
RouteValueDictionary routeValues, IDictionary<string,object> htmlAttributes);
RouteLink(string linkText,string routeName,string protocol,string hostName,
string fragment,object routeValues,object htmlAttributes);
RouteLink(string linkText,string routeName,string protocol,string hostName,
string fragment,RouteValueDictionary routeValues,IDictionary<string,object> htmlAttributes);
部分例子:
该类主要用于生成相关链接,主要扩展了ActionLink和RouteLink方法
2.ActionLink
ActionLink扩展方法主要实现一个连接,共有十个重载方法
ActionLink(string linkText,string actionName);
ActionLink(string linkText,string actionName,object routeValues);
ActionLink(string linkText,string actionName,object routeValues,object htmlAttributes);
ActionLink(string linkText,string actionName,RouteDictionary routeValues);
ActionLink(string linkText,string actionName,RouteDictionary routeValues,
IDictionary<string,object> htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName);
ActionLink(string linkText,string actionName,string controllerName,object routeValues,
object htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName,RouteDictionary routeValues,
IDictionary<string,object> htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName,string protocol,string hostName,
string fragment,object routeValues,object htmlAttributes);
ActionLink(string linkText,string actionName,string controllerName,string protocol,string hostName,
string fragment,RouteValueDictionary routeValues,IDictionary<string,object> htmlAttributes);
2.RouteLink
RouteLink(string linkText,string routeName,object routeValues);
RouteLink(string linkText,string routeName,RouteValueDictionary routeValues);
RouteLink(string linkText,string routeName,object htmlAttributes);
RouteLink(string linkText,RouteValueDictionary routeValues,IDictionary<string,object> htmlAttributes);
RouteLink(string linkText,string routeName,object routeValues,object htmlAttributes);
RouteLink(string linkText,string routeName,
RouteValueDictionary routeValues, IDictionary<string,object> htmlAttributes);
RouteLink(string linkText,string routeName,string protocol,string hostName,
string fragment,object routeValues,object htmlAttributes);
RouteLink(string linkText,string routeName,string protocol,string hostName,
string fragment,RouteValueDictionary routeValues,IDictionary<string,object> htmlAttributes);
部分例子:
Code