I've a class like below
public class IndexModel : PageModel
{
public PersonModel Person { get; set; }
public ActionResult OnPostSubmit(PersonModel person)
{
if (person.name !=null)
{
ViewData["Name"] = person.Name;
return Redirect("~/path/");
}
}
}
here I'm getting not all code paths returns a value error. I just want to
redirect to another page if name property has value else i want stay in the same page.let me know if you have a solution. thanks