【发布时间】:2011-03-08 12:28:42
【问题描述】:
MVC2 中的 ActionResult 方法重载有问题
我有 3 种方法
public ActionResult MyMethod()
{
var data = ........
//some unfiltered data from db
return view(data);
}
public ActionResult MyMethod(string name)
{
var data = .......
Where xxx.StartsWith(name)
//some filtered data by name
return View(data);
}
public ActionResult MyMethod(int age)
{
var data = .......
Where xxx.Equals(age)
//some filtered data by age
return View(data);
}
如何在 Asp.Net MVC2 中重载方法? 谢谢。
【问题讨论】:
标签: asp.net-mvc-2 c#-4.0