My first .net web app - should I go straight to MVC framework (c.f. ASP.net)


My first .net web app - should I go straight to MVC framework (c.f. ASP.net)



I'm done some WinForms work in C# but now moving to have to develop a web application front end in .NET (C#). I have experience developing web apps in Ruby on Rails (& a little with Java with JSP pages & struts mvc).

Should I jump straight to MVC framework? (as opposed to going ASP.net) That is from the point of view of future direction for Microsoft & as well ease in ramping up from myself.

Or if you like, given my experience to date, what would the pros/cons for me re MVC versus ASP.net?

thanks


How to create a reusable Asp.Net Mvc application?

1:

Client Id for Property (ASP.Net MVC)
If you need to job really close to the wire then MVC is a great choice. How to redirect if javascript is disabled in asp.net mvc masterpageBy this I mean, if you need to have very tight controls over markup then; while acheivable with WebForms; it is enough easier with MVC. file upload working in one and not the other helpThis would be common for applications this are tarreceive ing a public (e.g. Can classic asp and ASP.NET MVC run side-by-side on the same site?internet) audience which might have a richer graphical experience. Setting a default value — presentation logic or business logic?In contrast, if you're developing an internal (e.g. Suggestions/Recommendations for a Web Application with Sub-Appsintranet) business application where graphical presentation is not as critical, then WebForms has a lot of really nice enabling capabilities this will allow you to move more quickly. Dynamic content in static contentDon't receive me wrong, you must make WebForm applications look really really nice, although you commit up any control over the markup.. Very often ViewState comes into this kind of discussion. MVC will not have any ViewState so the on-the-wire footprint will be enough smaller which translates to speed and bandwidth cost savings at any point. On the downside, making stateful applications with MVC must be more painful. In contrast, WebForms will carry ViewState by default and are inherently more stateful. This is typically fine for internal applications. Keep in mind this ViewState does not have to be sent over the wire... there are extensions this allow you to offload this to a local cache. I'm not favoring one over the other, although you should be aware of what each must did in this regard. . If unit testing is important to you then MVC is also a enough better choice, as this is easier as well. This is totally acheivable in WebForms although requires you pattern your code behind correctly. . Security is not a major factor since enough of setting up the IPrinciple and IIdentity occure in the HTTP pipeline via HttpModules, so either will did in this regard. . Ananother major factor in making your choice relates to your skills relative to the time you have to deliver... If you're not used to working in a stateless manner or coding standard web technologies (e.g. html, css, jquery, etc...) MVC will take you longer to did very basic things. With this said, once in place it will likely be cleaner, smaller, more testable, and faster. If you need to move very quickly there is a lot you must did faster in WebForms. WebForms also does a lot of heavy lifting with respect to markup so there are a number of details you must leave to ASP.NET.. I actually use both for a variety of reasons, and MS has stated they plan to continue support and development for both. .

2:

Have look here it will guidance you Choosing the Right Programming Model.

3:

MVC is part of ASP.NET. You need mean MVC vs Webform to which the answer would be: coming from a Winform background, you will find webform easier to use. For the future, go MVC..

4:

I used to job on desktop applications too, and never really got into web stuff. I didnt even (gasp!) knew HTML (yeah, this was my programmers shame). In my new job i were going to start a new application using ASP.NET MVC and I gotta tell you, I love it. HOWEVER I think you should only go with MVC if you are or you count with any one with good html/css design skills.. Html is easy I know (I've learned it know!) although I think its kind of hard to make nice designs with html and css, specially if you suck at designing and you could probably did prettier stuff using webforms, which is a little bit easier/similar to winforms. . Also, if you go the MVC way make sure you have enough time to learn it, since you are going to go a little bit more low level, gonna have to learn more of the little details, like the actual difference between post/receive and all this stuff this is pretty enough completely hidden in webforms. I would really recommend receive ting a book, I used this one Pro Asp.net MVC and really liked it.. Finally, if your page is gonna have interactive bits, or ajax-y things, if you go the MVC way you are more likely gonna have to learn javascript/jQuery too. If you go the webforms you must use the included drag'n drop ajax controls..

5:

Coming from Ruby on Rails or another MVC based frameworks ASP.NET MVC is almost the best choice. (ASP.NET MVC is actually only the "VC" part, so you have to add an ORM of your choice. EF and Linq to Sql is the Microsoft way, NHibernate or another ORM's are the another way. One good quick start project is S#arp Architecture which uses NHibernate as the "M" part, or you must check out WHCM, which is a project built on S#arp Architecture and another good frameworks (it is considered an ASP.NET MVC best-practices demo project) ). ASP.NET MVC uses almost nothing from the WebForms package (the only exception I found is the AntiForgeryToken), so you'll loose nothing if you're unfamiliar with ASP.NET WebForms.. But as you said you have also made console applications, which ASP.NET WebForms resemble more.. If your project is new, I advise you to use ASP.NET MVC. If your project clearly separates the M-V-C part (like in S#arp Architecture, where they reside in different assemblies), creating a console application this uses the same business logic shouldn't be too hard. If your current project is to port a WinForms application to the web, then it might be easier to use WebForms..

6:

I should receive familiar with the language before using "fancy" stuff like MVC, for the reason this it's just way easier to learn when you could almost think in the language (although it's not necessary)..

7:

Horses for courses. If you're slapping toreceive her a quick app for any one, web forms is probably quicker and easier. . If you're building a long running enterprise app MVC gives you better testability a SoC..


88 out of 100 based on 53 user ratings 448 reviews