标签:orm code form home 表单 string route 路由 条件
public ActionResult Login(string name, string pwd)//传进来的字符串实际没用上
{
//取值
//至少有3种方法能够拿到前台Form表单submit提交过来的数据,必要条件:<input type="text" name="name"/>;;其中name是必要的
//第一种:
var name1 = Request["name"]; 或 +.ToString()
//第二种::前提要Login( string name )
var name2 = name;
//第三种;
var name3 = Request.Form[0];
return View("Index");
//跳转
//转到当前Controller下action,,可以写 return RedirectToAction("Index");或 return RedirectToAction("Login");!!!!!!!!!!!!!!!!!!!!!!!!!!!
//return RedirectToAction("Index");
//转到Select_Controller下Index-action,
//另一种跳转:路由跳转:
//return RedirectToRoute(new { controller = "Home", action = "Index" });
}
标签:orm code form home 表单 string route 路由 条件
原文地址:https://www.cnblogs.com/jsll/p/11684192.html