Asp.net mvc 如何传递MVC控制器中定义的多个参数?

Asp.net mvc 如何传递MVC控制器中定义的多个参数?,asp.net-mvc,Asp.net Mvc,如果我有一个MVC方法,如下所示: public ActionResult MVCMethod(string a,string b) {……} public ActionResult MethodTest(string a,string b){……} public ActionResult MethodTest(string a){……} public ActionResult MethodTest(string a,string b,string c){……} 如何在内容中传递这两个参数?

如果我有一个MVC方法,如下所示:

public ActionResult MVCMethod(string a,string b)
{……}
public ActionResult MethodTest(string a,string b){……}
public ActionResult MethodTest(string a){……}
public ActionResult MethodTest(string a,string b,string c){……}
如何在内容中传递这两个参数?或者我必须像下面这样定义我的函数,然后使用一个内容传递给a,从uri传递给b

 public ActionResult MVCMethod([FromBody]string a,string b)
    {……}
另一个问题是——MVC不支持使用相同方法的重载函数吗?如下所示:

public ActionResult MVCMethod(string a,string b)
{……}
public ActionResult MethodTest(string a,string b){……}
public ActionResult MethodTest(string a){……}
public ActionResult MethodTest(string a,string b,string c){……}

如何在内容中传递这两个参数是什么意思?
使用mvc属性路由或适当定义路由,或者在ajax请求的情况下确保匹配参数名称。在get-request-use[FromUri]和post-request-use[FromBody]@Reddy:我的意思是如果我想把两个值传递给函数中定义的两个参数,我不想使用类似“a.aspx?a=1”的东西(我不想直接通过url传递参数)。这两个字符串参数都应该通过正文内容分配,这样可以吗?@J-D:请参阅“@Reddy”注释。这就是我想要做的。你可以在action属性中使用model