Hi everyone, my company just recently purchased the Kendo UI control suite and we're experimenting with some different approaches for a new site we're going to begin working on. One thing we are definitely doing is using MVC5 / EF6 - and for a while we were thinking it might make sense to take a JS MVVM approach on the client, but I'm starting to think otherwise. We would like to have a rich client experience, but I think minimizing development time is more important.
I have two questions:
First, does it make sense to do a combination of MVVM and MVC? We would have ASP.NET MVC just return a JSON result that gets consumed by Kendo MVVM, I suppose. It seems like we would miss out on our annotated unobtrusive validation though with this approach - is that a correct assumption? What other pros and cons are there to this approach?
Second, is there a better way to write this DropDownList implementation? I know I could do it without the Helper methods, but I'm just curious if I could use the Helper and keep the code to a minimum while using MVVM:
Thank you,
-Adam
I have two questions:
First, does it make sense to do a combination of MVVM and MVC? We would have ASP.NET MVC just return a JSON result that gets consumed by Kendo MVVM, I suppose. It seems like we would miss out on our annotated unobtrusive validation though with this approach - is that a correct assumption? What other pros and cons are there to this approach?
Second, is there a better way to write this DropDownList implementation? I know I could do it without the Helper methods, but I'm just curious if I could use the Helper and keep the code to a minimum while using MVVM:
<
div
>
@*Example using Kendo / MVVM*@
@Html.Kendo().DropDownList().Name("TestDropdown").DataTextField("name").DataValueField("id").HtmlAttributes(new Dictionary<
string
, object> { { "data-bind", "value: person.contactType, source: contactTypes" } })
</
div
>
<
div
>
@*Example binding directly to MVC ViewModel*@
@Html.Kendo().NumericTextBoxFor(x => x.TestInt)
</
div
>
Thank you,
-Adam