后台取值+跳转

 public ActionResult Login(string name, string pwd)//传进来的字符串实际没用上
        {
            //取值
            //至少有3种方法能够拿到前台Form表单submit提交过来的数据,必要条件:;;其中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" });
            }

你可能感兴趣的:(后台取值+跳转)