I have a custom popup editor which has a DropDownListFor which has a datasource. I need to pass a parameter to the Read method which is a .NET action. The parameter needs to be whether or not we are in update or create mode.
I currently pass CompanyId from the ViewData but I need one more param as mentioned above. Since Model is null always in Edit or Create mode I cannot key off of that.
@Html.LabelFor(m => m.UserId)
@(Html.Kendo().DropDownListFor(m => m.UserId)
.OptionLabel("Select..")
.DataTextField("Text")
.DataValueField("Value")
.DataSource(dataSource => {
dataSource.Custom()
.Type("aspnetmvc-ajax")
.Transport(transport => transport.Read("Global_SalesUsers_DropDown", "Company", new {companyId = companyId}))
.Schema(schema => schema.Data("Data"))
.Events(events => events.RequestEnd("processViewDataResponse"));
})
)
@Html.ValidationMessageFor(m => m.UserId)