I have set up a form component and specified an action - however when debugging I can see that the form seems not to be posting to the action I have specified.
This is the form code :
@(
Html.Kendo().Form<Customer>()
.Name("portalForm")
.HtmlAttributes(new { action = "EditPortal", method = "POST" })
.Items(items =>
{
items.Add()
.Field(f => f.CustomerId)
.Editor(editor => editor.Hidden());
items.Add()
.Field(f => f.Customer_Guid)
.Editor(editor => editor.Hidden());
items.Add()
.Field(f => f.AppId)
.Editor(editor => editor.Hidden());
items.AddGroup()
.Label("Settings")
.Layout("grid")
.Grid(g => g.Cols(4).Gutter(20))
.Items(i =>
{
i.Add()
.Field(f => f.CostCentresActive)
.Label(l => l.Text("CostCentresActive:").Optional(true))
.Editor(e =>
{
e.Switch()
.Messages(c => c.Checked("YES").Unchecked("NO"));
});
i.Add()
.Field(f => f.CostCentreHide)
.Label(l => l.Text("CostCentreHide:").Optional(true)).Editor(e =>
{
e.Switch()
.Messages(c => c.Checked("YES").Unchecked("NO"));
});
i.Add()
.Field(f => f.CustomTextActive)
.Label(l => l.Text("CustomTextActive:").Optional(true)).Editor(e =>
{
e.Switch()
.Messages(c => c.Checked("YES").Unchecked("NO"));
});
i.Add()
.Field(f => f.DepartmentsActive)
.Label(l => l.Text("DepartmentsActive:").Optional(true)).Editor(e =>
{
e.CheckBox();
});
});
})
)
The rendered html seems to suggest it will post to the EditPortal action, but when I click submit it posts to the Edit action which is what rendered the page with the form on in the first place.
It is a little complicated by the fact that my form component is inside a partial view, which in turn is in a tabstrip on the main Edit view.
I am probably overlooking something very simple here!
Thanks