Sep 29, 2015, 2:51 PM
[CLOSED] Model DateField on submit returns null
Hello
What could be a problem when DateField won't bind from form? If I have for example view like this:
What could be a problem when DateField won't bind from form? If I have for example view like this:
@model TestSubmit.Models.MyObject
@(Html.X().Window().Width(450).Title("My object")
.Items(
Html.X().FormPanel().AutoDataBind(true).ID("FormPanel1").Frame(true).DefaultAnchor("100%").BodyPadding(6)
.Items(
Html.X().HiddenFor(m=>m.IDProperty),
Html.X().TextFieldFor(m => m.StringProperty).ID("firstControl").SelectOnFocus(true),
Html.X().CheckboxFor(m=> m.BooleanProperty),
Html.X().DateFieldFor(m=> m.DateProperty),
Html.X().TextFieldFor(m=> m.IntegerProperty),
Html.X().TextFieldFor(m=> m.FloatProperty)
)
.Buttons(
Html.X().Button().ID("OK").Text("Ok").Icon(Icon.Disk)
.DirectEvents(de =>
{
de.Click.Url = Url.Action("Submit");
de.Click.EventMask.ShowMask = true;
de.Click.FormID = "FormPanel1";
de.Click.Success = "this.up('window').close();";
})
,
Html.X().Button()
.Text("Cancel")
.OnClientClick("this.up('window').close();")
)
)
)
On action Submit:public ActionResult Submit(MyObject myObject)
I get DateProperty as null. All other properties are bound well...
Last edited by Daniil; Oct 06, 2015 at 12:07 PM.
Reason: [CLOSED]