Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Model Binding for MVC only?
Message
De
01/07/2014 12:53:54
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01602973
Message ID:
01603000
Vues:
52
>I just listened to a Pluralsight course on mobile web applications. A topic of Model Binding came up in the course as a suggestion to eliminate ViewState. My question; is Model Binding applicable to ASP.NET MVC only; or it can be used in ASP.NET Web Forms?
>
>UPDATE:
>Found this link http://blogs.msdn.com/b/webdev/archive/2013/03/28/tutorial-series-on-model-binding-with-asp-net-web-forms.aspx which probably answer my question.

I guess it works - but, to me, it looks horrible. For instance, the models contain information about the view (e.g 'Display Name') and have methods that imply knowledge of the view (e.g. 'studentsGrid.GetData'). Admittedly the latter is only because of the chosen method name - but you might equally wish, in a different view, to display students as a list, write it to a PDF, or, or......

I've given up on Web Forms entirely - re-delivering the whole page from the server every time the data changes seems silly.

Using static html pages and WebApi with, for instance, angular is so much more flexible (and faster).

BTW, have you looked at TypeScript (or CoffeeScript) instead of plain JavaScript - it takes you a long way towards having strongly-typed objects (with type checking and intellisense) in JavaScript which can then be easily mapped to C# objects on the server.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform