Suppose the cshtml file looks like this: Copy code The code is as follows: <br> $(document).ready(function(){<br> $("#btn").click(function(){<br> > url: "/Home/MyAjax",<br> data: {<br> val1: $("#txt1").val(),<br> val2: $("#txt2").val(), <br> val3: $("#txt3").val(),<br> val4: $("#txt4").val(),<br> },<br> dataType: "json"<br> });<br> ; <input id="txt1" type="text" value="" /><br><input id="txt2" type="text" value="" /><br><input id ="txt3" type="text" value="" /><br><input id="txt4" type="text" value="" /><br><br><br> <br>data is json data. The Action passed to is /Home/MyAjax. Then the way to receive it at the Action method is as follows: <br> <br><br> </div> <p>Copy code</p> <p></p> <div class="codetitle"> The code is as follows:<span><a style="CURSOR: pointer" data="55342" class="copybut" id="copybut55342" onclick="doCopy('code55342')"><u>public ActionResult MyAjax(string val1) val2 = Request["val2"].ToString();</u> string val3 = Request.Form["val3"].ToString();</a> string val4 = Request.Params["val4"]. ToString() ;</span> return Content("ViewUserControl1"); </div> Or the receiving parameter is FormCollection, which has the same effect. <div class="codebody" id="code55342"> <br><br><br><br><br>Copy code<br><br> </div> The code is as follows:<p></p> public ActionResult MyAjax(FormCollection f) {<p> string val2 = f["val2"].ToString();</p> <div class="codetitle"> string val3 = f["val3"].ToString();<span> string val4 = f["val4"].ToString();<a style="CURSOR: pointer" data="33316" class="copybut" id="copybut33316" onclick="doCopy('code33316')"> return Content("ViewUserControl1");<u> }</u></a></span> </div> The power of MVC3 is that it is based on the variable parameter naming matching mechanism, which means that it tries its best to find values with the same variable name. For the above example, we can even construct a class as follows: public class aclass {<div class="codebody" id="code33316"> <br><br><br><br><br>Copy code<br><br> </div> The code is as follows:<p></p> public string val1 { set; get; }<p> public string val2 { set; get; }</p> <div class="codetitle"> public string val3 { set; get; }<span> public string val4 { set; get; }<a style="CURSOR: pointer" data="72837" class="copybut" id="copybut72837" onclick="doCopy('code72837')">}<u></u></a> </span>Then you can set the parameter type to aclass</div> <div class="codebody" id="code72837"> <br><br><br><br>Copy code<br><br> </div> The code is as follows:<div class="codebody" id="code54274"> <br> public ActionResult MyAjax(aclass f) {<br> return Content(f.val1 f.val2 f.val3 f.val4);<br> }<br> </div> <p>Note that the attribute name of the aclass class is the name of the json key. As long as it is consistent, it will match, which is very powerful. </p>