Dr.Ajay Kashyap

Dr.Ajay Kashyap

  • NA
  • 521
  • 284.1k

How to Clear Model Property value in mvc

Dec 20 2016 6:52 AM
i want to clear the value of categoryid when redirect to the page 
Model:-
 
public class AddBusinessLocationViewModel
{
public Nullable<int> City_Id { get; set; }
public Nullable<int> CityArea_Id { get; set; }
public Nullable<int> state_id { get; set; }
public string OpenTime { get; set; }
 
public List<int> CategoryId { get; set; } 
 
 
Controller:-
ModelState.Clear();             //this will clear all value
return View(BVM);
 }
  

Answers (7)