Tag: 后期

POST json字典

我正在尝试以下方法:带有字典的模型在第一个Ajax请求上发送它,然后将结果再次序列化并将其发送回控制器。 这应该testing我可以在我的模型中找回字典。 它不起作用 这是我的简单testing: public class HomeController : Controller { public ActionResult Index (T a) { return View(); } public JsonResult A(T t) { if (t.Name.IsEmpty()) { t = new T(); t.Name = "myname"; tD = new Dictionary<string, string>(); tDAdd("a", "a"); tDAdd("b", "b"); tDAdd("c", "c"); } return Json(t); } } //model public class T { […]