Hello I have the following code and i don't know were is the mistake
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(factura fac)
{
if (fac.numar>0)
ModelState.AddModelError("numar", "Numar este invalid .");
if (fac.serie.Trim().Length == 0)
ModelState.AddModelError("serie", "Serie invalida");
if (!ModelState.IsValid) return View("Create", fac);
}
Here i try validate an texbox "serie" and i got the following error Object reference not set to an instance of an object.
thank you