Asp.net MVC VS ASP.net WebForms? - asp.net

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.

Related

Best practise to migrate Web Forms to ASP.NET Core MVC

I am trying to migrate a project from classic ASP.Net Web Forms to ASP.NET MVC.
While I have read through http://www.codeproject.com/Articles/38778/ASP-NET-WebForms-and-ASP-NET-MVC-in-Harmony. I have a basic idea on how the code structure, libraries and routing should be done.
For your information, the scope of my existing project is around 400 pages and 300 tables.
On top of my head I have two approaches:
Start from stretch, rewriting the whole system - Obviously this would require intensive work and take a long time. Any change made on existing system would need a duplicate change made to the new system.
Migrate the page one each - I still have a rebuild the entire core library (for accessing db), and get the page migrated one by one. For this I would assume to have two core libraries (new and old) running simultaneously with different pages connect to one of those.
Would anyone have similar experience and advise a proper way to start?
For this complete revamp I may also target at the latest technology - .NET Core and MVC6, by taking these would I have extra advantage, or some blockages I would have to take care of?
Any suggestion and opinions are appreciated. Cheers.
Microsoft is a bit hush hush on the subject but the WebForms engine is probably never going to make its way to ASP.NET Core. One might think that MS is waiting to see if the community is calling for a port, but I think they're trying to kill it discretely (not like Silverlight).
Why? Because it proved to be a bad good idea on the long run, easy to use at first, but extremely complex to master (because of viewstate and page lifecycle), with a tendency to allow average developers to build very tedious application (in french we say steam factories). Also it was very poorly adapted to modern web development (Ajax, unit testing, IoC). They tried to fix it with a couple of tweaks, but the overall architecture is just not adapted to this kind of things. MVC is a treat in comparison!
To answer your question, it's not really possible to migrate WebForms to MVC, because those are quite different architectures, and of course the architecture is what an application sits on top on, so if you change it, you might as well rewrite it from scratch.
What can help you a lot is if your app is divided in tiers (business, data access, UI). If it's not the case, you could start by doing this, properly separating the UI project from the rest. Then you would just have to rewrite the ASP.NET project and not the rest.
There are some useful resources I'd like to share with the StackOverflow community just in case you are having troubles to decide what to do:
modernization of your existing Web Forms app
migration to MVC or Core
or whether to start a new project on Web Forms, MVC and Core.
Here you go:
https://www.telerik.com/blogs/review-of-telerik-toolsets-for-aspnet-web-forms-core
Modernizing ASP.NET Web Forms Applications by Tomáš Herceg (Microsoft MVP ) - https://tomasherceg.com/blog/post/modernizing-asp-net-web-forms-applications-part-1
Migrating Old ASP.NET Applications to .NET Core by Edi Wang (Microsoft MVP) - https://edi.wang/post/2018/10/31/migrating-old-aspnet-applications-to-net-core
Choose between ASP.NET and ASP.NET Core (Microsoft docs) - https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework?view=aspnetcore-3.1
Migrate from ASP.NET to ASP.NET Core (Microsoft docs) - https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-3.1
i have come across below links
https://www.youtube.com/watch?v=CZuqMrWSano
https://www.dotvvm.com/blog/59/Modernizing-ASP-NET-Web-Forms-applications-with-DotVVM
DotVVM package helps us to migrate ASP.Net Web Forms migration to ASP.NET Core without re-writting completely.
i have not tried any production application. still have tried some sample pages. you can try this out.
I can agree that for many cases a re-write of an ASP.NET application where WebForms is used widely may do not provide any business value.
Therefore we decided to use our experience with ASP NET WebForms to develop a highly compatible port of WebForms for ASP NET Core / .NET 6.0.
We use the solution in our own ASP NET WebForms-based products and projects as well as a licensable component library.
So the Forms can still be used and you can focus on the .NET CORE/6 migration.

Confusion on using asp.net or mvc

Ive been confused about ASP.NET MVC.
As some said, MVC is better than ASP.NET. As some said, they are completely the same thing.
And my colleges debate that MVC is just an extension of asp.net, where asp.net is already in the form of MVC.
In fact I am starting web developing from scratch. If someone might help to clear the fog front of me, it would help a lot.
All ASP.NET web frameworks are build on top of Microsoft ASP.NET Framework. The unique feature of Web API is that it can be used with both MVC and WebForms applications to provide truly restful HTTP services.
Regarding the choice of suitable Asp.NET framework: you may get more information from official source - www.asp.net.
General rule of thumb is the architectural design how you want to build your application.
ASP.NET MVC promotes a cleaner separation which makes the developer think more in depth about design and code separation than traditional web forms.
There are endless debates about what is better but true benefits of ASP.NET MVC as
testability
more control over the rendered HTML
separation of concerns. However with MVC there is much more to learn for the developer.
ASP.NET WebForms - will always be around because some see it as a rapid application development tool. Just drag and drop and let ASP.NET handle the posting, state etc
ASP.NET Web API - is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
All in all, each of them has certain business solutions to be considered as required.
References to look for comparison:
ASP.NET MVC vs WebForms: speed and architecture comparison
ASP.NET Roadmap: One ASP.NET – Web Forms, MVC, Web API, and more
ASP.NET is the name of the overall web framework. There are a few different technologies that are built on ASP.NET. Two popular examples of these technologies are WebForms and MVC.
WebForms promotes a programming model that looks a lot more like Windows Forms. It attempts to abstract away the stateless nature of the web, and encourages you to use server-side controls instead of HTML. Because WebForms was the primary way to write web applications on ASP.NET for a long time before MVC came out, you'll often see people talk about "ASP.NET" as the same thing as WebForms. This is part of the reason for your confusion. ASP.NET WebForms is very different from ASP.NET MVC, but they are both built on ASP.NET.
ASP.NET MVC gets away from server-side controls. It eliminates the abstractions, allowing you to have closer control over the actual HTML that gets generated. For developers of modern applications, this is very useful because it makes it much easier to use AJAX and rich client-side javascript.
(Humble Opinion incoming)
ASP.NET (in terms of using Webforms) is programming the web for a WinForms developer. You "bind" events, you have "controls" and everything (sessionstate) is stored in a huge hidden field within the page so it knows where it left off from the previous call. You rely heavily on this information being present which is why everything you do needs to reside in that master form wrapping the entire page.
On the other hand, MVC is bringing C# .NET programming back to the web the way the web was intended. No bloat, no hidden fields, no heavy bindings. It's brings everything back to the classic "i have this form and now I need to process it". Arguably, the real magic is the routing methods and the "automatic binding" of submitted fields to an object. (if fields x, y & z are submitted and your action is looking for FooBar with the properties x, y & z it's automatically converted for you.
ASP.NET is common to both WEB-API and ASP.NET MVC. I assume you wonder about MVC or WEB-API.
MVC is a controller / model based with Views. Although the controllers can be used for AJAX json purposes. MVC is a good way to build a serious Browser based Application. The WEB-API allows you to build simple http server features, not necessarily Browser related. Good for REST style programming. Very flexible and a good alternative to WCF services. The are good tutorials on Both on the official ASP.NET site. START here http://www.asp.net/get-started
choose depends on your project n you. I suggest you to choose MVC because its productivity is very high we r using it since 1 year and found better than webforms.
for more knowledge please visit http://www.asp.net/mvc
The choice depends completely on you, I have been developing MVC application since 2010, its going to be over 2 years now have worked with almost all the versions of MVC both with Razor and aspx view. I have also worked on ASP.Net webform based applications.
With MVC you will not get built in controls, you will have to develop every control you want to use, you will have to rely mostly on html controls, while with web forms you will get advantage of using built in controls, Even getting help from other developers in your surroundings may be easy for webforms as you can easily get a webform developer.
But on the other hand with MVC the maintability is very high. As for as productivity is concerned, its very high once your are accustomed to it, initially it will be low as you will be in learning phase. Don't forget to use Entity Framework.
You may also consider developing your App using WebAPI, if it suits your scenario.

learning web app development with asp.net

I have been doing windows applications using c#.
But recently our management has planned to make some of the projects to be web based.
We thought of using asp.net with c#.
Can anybody guide me on effectively learning asp.net.
pls provide some useful links for sample projects.
Thanks in advance.
Web Forms would be a quicker route if your used to desktop development (over microsoft MVC). MVC3 is my preference but takes a bit longer to get used to if your not familiar with it. MVC3 gives you more control over your code and in my oppinion is less bloated.
May be worth looking into the MVC pattern if you go down this route.
Loads of videos to get you started here: http://www.asp.net/web-forms
They have a couple of example applications you can work through:
Web Forms: Contoso University App
MVC: MVC3 Starter App
as simple as this: http://www.asp.net
I'd recommend to start with ASP.Net MVC even you'll find it a bit complex in the beginning , Here you can find a lot of tutorials and books
you can also take a look at the MVC Music Store , it is a complete project to learn ASP.Net MVC by example.
I would steer clear of WebForms - even though it may seem a more natural fit coming from your WinForms background, you will run into issues later on. Given that you're going to have to learn a new platform anyway, makes sense to learn MVC and get off on the right foot (note that there are alternative MVC frameworks to ASP.NET MVC such as Fubu but these are probably riskier options in your situation).
PluralSight do some good online training courses, though you do need to pay for them.

ASP.NET: Web Development Choices

I have been learning to develop websites using ASP.NET MVC 2 for work... and previous to this, I had never developed within an .NET environment before. Since I jumped right into using MVC, I honestly have no idea how else to develop websites with ASP.NET.
I've heard about "WebForms" here and there, but don't really get the difference. But, beyond that, what other means of web development is there with ASP.NET?
It's all very backwards, I know... but if you can just humor me and perhaps list the different ways of utilizing C# to develop great web applications, that would be extremely useful.
ASP.NET is the platform for developing .NET web applications.
Sitting on top of that platform is two technologies to choose from:
ASP.NET Web Forms
ASP.NET MVC
Web Forms uses WinForms-style development - drag/drop, event handlers, page lifecycle, statefulness with ViewState - all things evil in my opinion.
MVC as you know has no page lifecycle, no event handlers, no server controls (you can, but not recommended/required), no ViewState.
Don't really know what else i can say without going into too much detail.
Both technologies will be continued to be supported/enhanced.
But since your already versed in ASP.NET MVC - i seen no benefit in learning Web Forms. It would be a step back if anything.
As for this statement:
just humor me and perhaps list the different ways of utilizing C# to develop great web applications
That's a bit too broad/subjective.
What is "great"? Well performing? Looks good? Maintainable? All of the above?
No doubt - MVC will do a better job at most things than Web Forms.
Only feasible choice for a Web Forms app might be a intranet application where tons of complex grids/controls are required, and things like SEO/AJAX is not required.
Everything else should be done in MVC IMO.

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.

Resources