|
- I suppose it does but I need to confirm it: Does the client block utilize knockout.validation library?
No! It uses the standard jQuery.Validation plugin for conformity withe the remainder of the Mvc Framework. When you have a ServerSide ViewModel you can send just a part of it on the client side as a client Side ViewModel, the
remainder of the model will continue working as....normal Mvc model with unobtrusive js and so on ...so for uniformity both use the jQuery validation plugin. HOWEVER, there are Mvc Controls Toolkit plugins, that allow they work well also with knockout...this
is completely transparent to you. Moreover you can add also errors coming from the sever in various way, if the page is submitted WITHOUT ajax there is a ServerErrors call to be done in the razor or aspx function that add all sever errors automatically at
the right places.
See:
http://www.dotnet-programming.com/post/2011/10/28/Low-BandWidth-Transfers-with-Client-Side-Templates-of-the-Mvc-Controls-Toolkit.aspx
http://www.dotnet-programming.com/post/2011/10/29/Handling-Big-Amounts-of-Data-with-Client-Side-Templates.aspx
http://www.dotnet-programming.com/post/2011/10/29/Handling-Big-Amounts-of-Data-with-Client-Side-Templates-2.aspx
If the page exchange json data either with an Api controller or with a normal controller in json: you cn use the updateManager class refreshErrors that handles smartly server errors. see below
- I can't find any demo code using Client Blocks. Can you help please?
ALL TUTORIALS CONTAIN LINKS TO CODE INCLUDED THE ONES I LISTED ABOVE
Introduction to Client Blocks: http://mvccontrolstoolkit.codeplex.com/wikipage?title=Client%20Blocks
basic example contained in the examples that come with the codeplex binaries: http://mvccontrolstoolkit.codeplex.com/wikipage?title=Client%20Block%20complete%20example
The three tutorials already listed above.
I wan't to use the framework to:
- Generate knockout viewmodels and templates from .NET classes
ok done automatically by client blocks.
- Send JSON between client and server
use the updateManager class, It works both with Mvc4 ApiControllers and Mvc3 standard controllers.
See my tutorials :
http://www.dotnet-programming.com/post/2012/04/03/Mvc-Controls-Toolkit-Support-to-Mvc4-WebApi.aspx
http://www.dotnet-programming.com/post/2012/04/12/Mvc-Controls-Toolkit-Support-to-Mvc4-WebApi-2-Handling-Relations.aspx
The tutorial speaks about ApiController of Mvc4 but everything about the updateManager apply
also to Mvc3 and among the code samples you can download there are also Mvc3 samples
- Utilize data annotations for client side (knockout validate) as well as server side validation.
Ok, you can! Everything is handled automatically by the various components of the Client Blocks you use you use
- Have composite pages composed of multiple views (partial views or client blocks or similar)
You can do more Mvc Controls toolkit have "Templates" that are a generalization of partial views: see here: http://mvccontrolstoolkit.codeplex.com/wikipage?title=Use%20of%20Templates
You can define also client side templates with templates that is with partial views and Razor helpers
- Globalization of all page text and validation messages
ok! just need to add the js globalization scripts. See here: http://mvccontrolstoolkit.codeplex.com/wikipage?title=Globalization
|