view  数据传递到controller   formcollection 是一个集合提交form 对象的集合

例如控制器获取view 表单数据

[AcceptVerbs(HttpVerbs.Post)]
       public ActionResult FormCollection(FormCollection formCollection)
       {
           Person person = new Person();
           person.FirstName = formCollection["FirstName"];
           person.LastName = formCollection["LastName"];
           return View(person);
       }

还有这种

public ActionResult List(FormCollection form)
{
int? index = int.Parse(form.GetValue("pageindex").AttemptedValue);
}

比较复杂一点

相关文章:

  • 2021-12-05
  • 2021-12-19
  • 2021-06-19
  • 2021-07-13
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
相关资源
相似解决方案