ASP.NET MVC路由扩展:链接和URL的生成(4)
来源:未知 责任编辑:责任编辑 发表时间:2014-02-02 17:48 点击:次
12: {
13: return this.Action(actionName, null, null, null, null);
14: }
15: public string Action(string actionName, object routeValues)
16: {
17: return this.Action(actionName, null,
18: new RouteValueDictionary(routeValues), null, null);
19: }
20: public string Action(string actionName, string controllerName)
21: {
22: return this.Action(actionName, controllerName, null, null, null);
23: }
24: public string Action(string actionName, RouteValueDictionary routeValues)
25: {
26: return this.Action(actionName, null, routeValues, null, null);
27: }
28: public string Action(string actionName, string controllerName, object routeValues)
29: {
30: return this.Action(actionName, controllerName, new RouteValueDictionary(routeValues), null, null);
31: }
32: public string Action(string actionName, string controllerName, RouteValueDictionary routeValues)
33: {
34: return this.Action(actionName, controllerName, routeValues, null, null);
35: }
36: public string Action(string actionName, string controllerName, object routeValues, string protocol)
37: {
38: return this.Action(actionName, controllerName, new RouteValueDictionary(routeValues), protocol, null);
39: }
40: public string Action(string actionName, string controllerName, RouteValueDictionary routeValues, string protocol, string hostName)
41: {
42: controllerName = controllerName ?? (string)this.RequestContext.RouteData.Values["controller"];
43: routeValues = routeValues ?? new RouteValueDictionary();
44: routeValues.Add("action", actionName);
45: routeValues.Add("controller", controllerName);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>