感谢您阅读本文。
想要将查询字符串中的数据传递给操作;网址
MyController/MyAction?lob=a
试过这个:
[HttpGet]
public ActionResult MyAction()
{
var model = new SModel();
model.lob = Request.QueryString["lob"];
return View(model);
}
[HttpGet]
public ActionResult MyAction(string lob)
{
var model = new SModel();
model.lob = lob;
return View(model);
}
[HttpGet]
public ActionResult MyAction(FormCollection values)
{
var model = new SModel();
model.lob = values["lob"];
return View(model);
}
“lob”始终为空。
有任何想法吗?