Exemplo n.º 1
0
 public ActionResult testeRequestParams(TesteIndexMVVM data)
 {
     if (!ModelState.IsValid)
     {
         ModelState.AddModelError("","Datele nu sunt valide pentru acest model");
     }
     return View();
 }
Exemplo n.º 2
0
        public ActionResult testeRequestParams()
        {
            //In ASP.NET, the Request.Params dictionary results from the combination of four distinct dictionaries: QueryString, Form, Cookies, and ServerVariables.
            var nume = Request.Params["nume"] ?? "nu a fost transmis un nume";
            ViewBag.nume = nume;

            //var Gigel = new TesteIndexMVVM {Nume = "Gigel", Prenume = "Ionel", Varsta = 120};
            var model = new TesteIndexMVVM();
         
            return View(model);
        }