This question is locked. New answers and comments are not allowed.
Hi,
I have an example working with a pop-up insert. It works fine except for the fact that the form doesn't have the defaults I want for the object to be inserted. I have the Insert method with the HttpPost attribute to save what is being filled out in the form, that works fine. However, my similar get function that returns a model with some defaults I want (ex. the current date) isn't coming back, I'm getting the min date. The get method isn't being hit when I click the "insert" button to pull up the popup. Example:
Can someone tell me how I can get this to work? I realize that maybe this could be done client side but there are complex objects that will need pulldowns for which I will need to set defaults for as well.
Thanks.
I have an example working with a pop-up insert. It works fine except for the fact that the form doesn't have the defaults I want for the object to be inserted. I have the Insert method with the HttpPost attribute to save what is being filled out in the form, that works fine. However, my similar get function that returns a model with some defaults I want (ex. the current date) isn't coming back, I'm getting the min date. The get method isn't being hit when I click the "insert" button to pull up the popup. Example:
public ActionResult Insert() { return View(new ObjectWithDefaults() { IsActive = true, StartDate = DateTime.Now }); }Can someone tell me how I can get this to work? I realize that maybe this could be done client side but there are complex objects that will need pulldowns for which I will need to set defaults for as well.
Thanks.