New to ASP.NET: Webforms vs MVC2 - asp.net

I am new to ASP.NET Development and can't decide between developing with Webforms or MVC 2. Nevermind the pros and cons of each. I've seen mixed opinions of each. But which method would be the best for someone who has no prior experience in ASP.NET or C#?
If your answer is: learn both, then which should I learn first? MVC 2 or Webforms?

I was in a similar situation to you a year ago. I'm a Computer Science student, well finished my course around a month ago. First two years of my course I worked with Java, PHP, Oracle, MySQL. This actually landed me an industrial placement at Oracle where I used their ADF which was Java based.
Anyway all of this made me start thinking about what I wanted to use for my final year project and with no experience of Microsoft technologies began to venture down that path. I wasn't aware of ASP.NET MVC and spent time learning ASP.NET WebForms. I liked the easy style of development, drag and drop is a very quick way of developing small sites. However I also disliked the lack of control I had and the simplicity, I didn't feel overly challenged.
During my final year I started to research Model View Controller and how it suits web applications. From this I came across ASP.NET MVC and in my opinion its far better than ASP.NET WebForms. There seems to be an emerging trend in MVC frameworks for web applications and this seems to be the hot technology to build web applications in.
Now finished I can say that teaching myself ASP.NET MVC was one of the best things I did. I don't know if you're British based, but only two Universities in Britain teach .NET. This made getting a graduate job much easier and I stood out from .NET candidates because I was from a Java course, the same as yourself.
The transition from Java to .NET is not particularly difficult all the theory and concepts are the same. Also ASP.NET MVC is becoming quite popular among businesses which specialise in the Microsoft technology stack. As it is quite a new technology learning now whilst young will be an advantage. I've ended up in a job where the company are rewritting their application from ASP.NET WebForms to MVC and only myself and the senior developer have ever used MVC leading to quite a large role in the project.
If you're interested my final year research can be found here and I have a chapter on ASP.NET WebForms and MVC
My source code is also on my site but its mainly MVC 1.0 not 2.0

Tough question.
What's your background in web development? Are you familiar with the MVC pattern?
Are you learning it for a job?
ASP.NET Web Forms are easier for beginners, as it hides much of the underlying implementation details of the ASP.NET engine.
ASP.NET MVC requires a deeper understanding of concepts such as routing and HTTP methods.
But yes - you should learn both.
As MVC is a new platform for developing ASP.NET Web Applications, i would learn Web Forms first. That way you will appreciate the benefits of MVC more when you contrast it to Web Forms.

if you want to get your hands dirty and really understand how the web works, go MVC
if you want to drag and drop your way to a functional but overhead loaded website, use webforms.
really, this question is pretty difficult to answer not knowing your background. if you're comfortable with html, css, javascript it may not be too difficult to pick up MVC. if you're new to the web entirely, it can be daunting to learn that many technologies all at once and webforms abstracts a lot of that kind of stuff for you.

There's a third option, especially useful for developers new to ASP.NET. You can use ASP.NET Web Pages, which is different from ASP.NET Web Forms. ASP.NET Web Pages is great for new developers as well as developers new to Web development. Also, it has a good path to migrate up to the complexity of ASP.NET MVC. In fact, the latest release of ASP.NET MVC and the latest release of ASP.NET Web Pages both use the same view engine.
Here is a link to the complete ASP.NET Web Pages book:
Getting Started with WebMatrix and ASP.NET Web Pages
Also, here is the complete WebMatrix Content Guide:
WebMatrix Content Guide
Here's the description:
WebMatrix is a free, lightweight set of web development tools that provides the easiest way to build websites. It includes IIS Express (a development web server), ASP.NET (a web framework), and SQL Server Compact (an embedded database). It also includes a simple tool that streamlines website development and makes it easy to start websites from popular open source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.

Related

ASP.NET MVC vs Routing

I'm deciding between using ASP.NET MVC, or standard ASP.NET Web Forms with URL routing for my application.
As far as I can tell, ASP.NET Web Forms with routing gives me clean URLs and I'll be able to use ASP.NET as I have been in the past. However, I've heard good things about ASP.NET MVC, which would gives native support for URL routing.
How does the workflow from ASP.NET Web Forms differ from ASP.NET MVC? Are there any major advantages to using MVC as opposed to web forms?
A good place to start is here as it shows strengths and weaknesses. There was also an article real recent in Dr Dobbs, Information Week or one of the other free mags I get that talked about when not to move to MVC. MVC helps enforce good process with technology (at least better than webforms) and is very condusive to SEO friendly URIs.
If I were biting this off, it would be MVC all the way, but I do not know your project, your team's knowledge, etc.
Whether you ultimately decide to go with WebForms or MVC, you should definitely learn MVC either way. Though Microsoft has made it pretty clear that development will continue on WebForms, many (including many here) already consider it outdated. True or not, MVC likely points the way to the future of .NET web development.
Also, having recently finished my first MVC project after spending some time in web and windows forms, I can attest to the learning curve - and parts of it are steep. But in the end the effort pays off. And then you'll have a personal perspective on the ups and downs and differences between the two.
I consider webforms a legacy product, mvc is a better fit for modern webdevelopment. But...there's a learningcurve, especially when you're coming from webforms. So, if time is limited, stick to what you know.

ASP.NET Razor web pages on large project?

I'm on the point of starting a medium scale web application and I'm considering developing using ASP.NET Razor syntax Web Pages framework (not MVC). But as I've seen many people consider "Web Pages" to be tailored towards beginners.
I'm developing professional large scale web applications in ASP.NET Web Forms for several years now, but I've always inclined towards clean html/javascript code more than server side controls therefore I find Razor syntax very much appealing. I'm using Visual Studio and not considering web pages for helpers functions or other beginner eye candy features.
Having this in mind what are your opinions on scalability, speed, long term development on this approach?
In terms of performance WebPages is asp.net and gets compliled so performance should be similar to WebForms and MVC.
I'd say that any site that could be built using ClassicASP, PHP or WebForms (without using server controls) can be built just as well using WebPages.
I prefer WebPages over WebForms and MVC for my sites. You get full control over the HTML, don't need to worry about concepts like the page lifecycle and postsbacks unlike WebForms. On the other side you get a lightweight, simple framework where you don't need to use VS.net, solutions files, project files and 3+ files to serve up a single page and you don't need to compile the entire solution before deploying unlike MVC.
But what you use I think depends mostly on your detailed requirements and skillset.
But as I've seen many people consider "Web Pages" to be tailored towards beginners.
Go for the ASP.NET MVC 3 and the Razor view engine then. It provides you with the WebPages syntax coupled with the full power of the MVC pattern built on top of an established platform such as ASP.NET in terms of scalability and long term development. You can't dream for better as far as the Microsoft stack is concerned.

ASP.NET MVC Experiences/Success Stories [2010]

At the moment we're evaluating whether it's worth it to start using ASP.NET MVC in combination with Visual Studio 2010.
I've been searching the web for experiences developers have had with working with ASP.NET MVC. I can't seem to find any. So I decided to post a question here.
Are there any people out there that have used ASP.NET-MVC for serious development? What are the experiences so far? Does ASP.NET-MVC help or hinder projects? Do you deliver your project on time? Does ASP.NET-MVC save you time or does it make you go over time and over budget?
And then the big question: Now that you've been working with ASP.NET MVC for a while, do you wish you had chosen an alternative? If that's the case, which alternative?
Thanks,
M
StackOverflow itself is an ASP.NET MVC site and I would say it is pretty successful.
I think it depends more on the people doing the actual implementation of the site than on the technology used how 'successful' the end result will be (successful in the broadest sense: on time, within budget, happy end users, ...).
Asp.net mvc is a better then asp.net webform some reason are here
the logic code in asp.net MVC is maintainable and clean.
he provide a better performance then webform
provide a pretty url for SEO and user-friendly.
full control on mockup [without using server-side control].
if you want to see there are many example of MVC project. stackoverflow.com is one of them.
I am a big fan of ASP.NET MVC (especially with the great improvements done in MVC3). I have worked on two big sites built entirely in MVC2 SempToshiba Brazil and Cyrela Brasil. These projects have been quite sucessful. They were delivered on time, saved time and our clients were very happy. Lastly, no, I would not have chosen an alternative. A side note, the Cyrela project was actually a re-do of a ASP.NET Web Forms site that had various downsides.
On the other hand, I have seen a large project done in MVC 2 by inexperience programmers, and it is one the worse projects I have ever seen. So, over all, ASP.NET MVC has some major advantages, but if the team is inexperienced in ASP.NET MVC you will get poor results.
On another note, this post has some great ASP.NET MVC 3 material.

Asp.net MVC VS ASP.net WebForms?

I am starting a new project in VB /.Net Framework 2.0 for a company corporate website with data driven forms. So should I go further with Asp.net MVC or Asp.Net web forms and WHY ??? We are not ready for Ajax now but later.
And also we have DevExpress components.
Actually I see ASP.NET MVC as next generation in that it is an evolution - trying to be a better programming environment, as software development for web apps asks for something more testable.
It is a huge beast. Decide based on features whether you need it. MVC has less documentation and is a lot harder to master thanks to a less RAD approach, but it seems that once you are in, it will be quite a better experience. If you have a web application (like stackoverflow.com) then it may be a good approach.
DevExpress components - have fun... throwing them away. Like most ASP.NET components they will not work or only work very partially. Totally different approach.e
ASP.Net MVC is not "next generation" ASP.Net. It's an alternative approach to design that can be more beneficial depending on the kind of project you're working with. Without more information about the particular type of project you're working on no one can give you any informed recommendations.

New to ASP.NET

I am wanting to learn ASP.Net and am just a beginner. I have done some windows c# forms development before but have no experience of web development.
I have looked at the ASP.net website but beyond this, does anyone have any ideas as to good learning resources particulary in relation to the differences to windows development. For instance, It seems that the way events work is quite different under ASP to windows forms.
Thanks you all.
Thank you very much. I will have a look at MVC. It looks even more complicated but if this is the way things are going then I would be better maybe to invest my learning in this.
I would advise you at this stage in ASP.NETs life to instead direct your attention at ASP.NET-MVC. This url http://www.asp.net/mvc/ is a very good resource for learning.
ASP.NET Forms do a good job of hiding the nature of a connection-less HTTP/browser based technology and presenting a familiar Form with controls and lots of useful events environment that Windows Forms developers are used to.
However this approach comes with a price. For any serious project there is no avoiding getting under the hood of ASP.NET forms and properly understanding the underlying technology. At this point you start to realise the significant compromises the ASP.NET Forms has had to make in order to make Windows Forms developers feel at home.
ASP.NET-MVC, on the other, makes no such compromises. Learning MVC means learning how HTTP works up-front. It also has the advantage of being a much more test friendly approach which when used properly will save you days of debugging.
ASP.NET website - seriously, it's a really good resource.
I'd seriously consider starting with ASP.NET MVC. You'll end up learning what you need from ASP.NET "classic" but you'll pick up all the goodness of MVC (testability, seperation of concerns in your code etc) instead of learning bad habits.
Google for "ASP.NET MVC", check out ScottGu's blog, Scott Hanselmans's blog, or search StackOverflow for ASP.NET MVC (use the ASP.NET MVC tag too).
One good place to start...
http://weblogs.asp.net/scottgu/archive/2009/04/01/asp-net-mvc-1-0.aspx
I know they are a bit out of date, but I still think the two Fritz Onion books give a great look at what's happening in ASP.NET under the hood.
Some resources:
asp.net (as you mentioned)
channel9
scott hanselman's blog (some useful entries)
Windows Client Homepage
W3Schools Tutorials (Useful for more than just .NET, but this is the .NET page)
I've been a .NET Windows Forms (not Web forms) developer for 1 and a half years. Then I switched jobs and started using WebForms for like... 2 years. Then I discovered ASP.NET MVC (January 2008) and since then although I still master ASP.NET WebForms I will always prefer ASP.NET MVC.
My recommendation also goes into ASP.NET MVC. You will have to learn HTTP, HTML and a bit of Javascript but after these you will master web development on ALL PLATFORMS.
A great alternative to ASP.NET MVC is ASP.NET Web Pages with Razor syntax. In fact, the latest release of ASP.NET MVC and the latest release of ASP.NET Web Pages both use the same view engine.
Here is a link to the complete ASP.NET Web Pages book:
Getting Started with WebMatrix and ASP.NET Web Pages
Also, here is the complete WebMatrix Content Guide:
WebMatrix Content Guide
Here's the description:
WebMatrix is a free, lightweight set of web development tools that provides the easiest way to build websites. It includes IIS Express (a development web server), ASP.NET (a web framework), and SQL Server Compact (an embedded database). It also includes a simple tool that streamlines website development and makes it easy to start websites from popular open source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.

Resources