Hi:
I am new to using Kendo UI. I am using MVC4 (VS 2012) with Kendo Mvc wrappers. I am trying to display a DropdownlistboxFor associated with a model item. Then during listbox change event i want to save that model (in the controller). I have hardcoded listbox items added to the listbox like in the code below. Should i post an ajax call which will call a controller method that saves model? How do i do this ajax post with model data sent to the controller action with the combo box updated data?
Is there any other way?
Thank you so much for your help.
=========================================
My model code is:
public class PackageModelView
{
public int DefaultReason { get; set; }
}
=========================================
View code (say named file Package.cshtml) has:
@using .<model namespace directory>
@model PackageModelView
@(Html.Kendo().DropDownListFor(model => model.DefaultAction)
.DataTextField("Text")
.DataValueField("Value")
.BindTo(new List<SelectListItem>()
{
new SelectListItem()
{
Text = "Active",
Value = "1"
},
new SelectListItem()
{
Text = "In-active",
Value = "2"
}
})
.Value("1")
)
I am new to using Kendo UI. I am using MVC4 (VS 2012) with Kendo Mvc wrappers. I am trying to display a DropdownlistboxFor associated with a model item. Then during listbox change event i want to save that model (in the controller). I have hardcoded listbox items added to the listbox like in the code below. Should i post an ajax call which will call a controller method that saves model? How do i do this ajax post with model data sent to the controller action with the combo box updated data?
Is there any other way?
Thank you so much for your help.
=========================================
My model code is:
public class PackageModelView
{
public int DefaultReason { get; set; }
}
=========================================
View code (say named file Package.cshtml) has:
@using .<model namespace directory>
@model PackageModelView
@(Html.Kendo().DropDownListFor(model => model.DefaultAction)
.DataTextField("Text")
.DataValueField("Value")
.BindTo(new List<SelectListItem>()
{
new SelectListItem()
{
Text = "Active",
Value = "1"
},
new SelectListItem()
{
Text = "In-active",
Value = "2"
}
})
.Value("1")
)