How Web page is a programming model to create ASP.Net web application - asp.net

ASP.NET Web Forms is a part of the ASP.NET web application framework. It is one of the three different programming models you can use to create ASP.NET web applications, the others being ASP.NET MVC and ASP.NET Web Pages.
I have read above lines in asp.net site. My understanding is A web page may refer to a html document retrieved from server and A Web Form is a thing in ASP.NET Application used to generate a HTML document(in dynamic manner)
But definition of web forms said by asp.net site confused me. OK I can understand MVC is a programming model used to create ASP.NET Web application.
What is a Web Form ? and What is a Web page ?
How Web page is a programming model to create ASP.Net web application

ASP.Net is Microsoft's technology stack for building dynamic web sites.
Within that stack, they support 3 different ways of generating a web page.
Web Forms is the oldest - it's been around since ASP.Net was born. It's tightly coupled into Visual Studio, and has "drag and drop" page building. Most people who care about how their HTML is constructed dislike Web Forms, because the "drag and drop" components can make it hard to generate semantic, valid HTML - though the latest version is a lot better.
ASP.Net MVC is an alternative to Web Forms - and it's a pretty decent MVC framework.
Web Pages is another alternative; it's more of a scripting/templating solution, similar to PHP. It doesn't have the overhead/safetynet of a proper framework behind it (like MVC), and it uses RAZOR to support the view engine.
For any non-trivial new projects, ASP.Net MVC is the industry standard.

Related

Does ASP.NET mean ASP.NET WebForms?

I have worked with ASP.NET MVC 5.0 and that is the only ASP* technology I have ever seen or worked with. I even searched on Goolge and got more confused.
For example in this book, what are they teaching? When they say ASP.NET, does it mean ASP.NET Web Forms?
Mainly my question is this: When I see ASP.NET , does it mean ASP.NET WebForms? ( Unless it is ASP.NET core or MVC, those two I know ) but I get confused between ASP.NET and ASP.NET WebForms?
Many years ago one time I dragged dropped some buttons and text boxes on a ASP.NET page, it was VS2003 :) I think, so was that ASP.NET WebForms and this book above is still the continuation of that one? Or we can use some sort of ASP.NET that is not WebForms or MVC or Core too?
ASP.NET is a technology which is developed by Microsoft. You use it 2 different ways which are ASP.NET Web Forms and ASP.NET MVC. These are pattern and they have changable usage for the user. They have many layer.
For easy example: https://www.tutorialspoint.com/asp.net/asp.net_introduction.htm That's All :))
ASP.NET is a framework for creating server side web applications so it's set of tools , API , libraries ...etc , web forms is just part from this framework , other parts include ASP.NET MVC, ASP.NET Web Pages, and ASP.NET Single Page Applications.
check this :
https://www.asp.net/web-forms/what-is-web-forms
If we turned back the time, ASP.NET was of course WebForms initially in 2001, so we don't even need to explicitly call it WebForms.
The meaning of ASP.NET only changed when Microsoft published ASP.NET MVC (and later Web API/SignalR/Web Pages), some time around 2010. From then on ASP.NET is the umbrella term to cover them all, as well as WebForms.
Recently ASP.NET Core was created as a brand new platform, different from all previous frameworks. Thus, IMHO ASP.NET Core != ASP.NET.
Back to the book cover, it should mean all things under ASP.NET 4.5, which includes WebForms/MVC/Web API/SignalR/Web Pages.
I actually have that textbook and the author presents the material using ASP.NET WebForms. I believe he covers MVC but in short detail; I can't remember offhand.
As for the other answers, yes, ASP.NET is Microsoft's web programming framework. There are basically three primary technologies that you can leverage: ASP.NET MVC, ASP.NET Web API (actually an extension of ASP.NET MVC), and ASP.NET WebForms. You can of course create other types of apps as well, such as SPAs, but these are definitely the primary technologies available to you. The nice thing about these is that you aren't necessarily tied to one technology - you can mix and match different technologies in one solution.
If you are completely new to ASP.NET, I would suggest you look at Microsoft's tutorials on building ASP.NET Core applications so you can leverage the cross-platform technologies Microsoft is heading towards. You mentioned that you've worked with ASP.NET MVC and .NET Core, so I'm assuming you're also aware that you can leverage ASP.NET Web API there as well.
https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/intro
Hope that helps.

what Parameters needs to considered while moving webform model to MVC pattern of ASP.NET framework?

I have gone all over internet however still confuse in choosing MVC or WEBform pattern of ASP.NET Framework.
i have an application which is Developed on Webform model, does it really require to move it to MVC?
Webform is quiet stable, why should we go for MVC?
I mean what parameters we need to consider before moving webform model project to MVC?
any help or redirection will be highly appreciated.
Thanks!
As mentioned in the comments, there is nothing special that forces you to move into MVC.
If you’re going to start a new project consider using MVC. Here are few points which you could get benefited while using ASP.NET MVC :
Asp.Net MVC is a lightweight and follow MVC (Model, View, Controller) pattern based development model.
Asp.Net MVC has html helpers.
Asp.Net MVC does not support view state. Asp.Net MVC has route-based URLs means URLs are divided into controllers and
actions and moreover it is based on controller not on physical
file.
Asp.Net MVC follow customizable syntax (Razor as default)
In Asp.Net MVC, Views and logic are kept separately.
Asp.Net MVC has Layouts for consistent look and feels.
Asp.Net MVC has Partial Views for code re-usability.
Asp.Net MVC is lightweight, provide full control over markup and support many features that allow fast & agile development. Hence it
is best for developing interactive web application with latest web
standards.
Asp.Net Web MVC is Open Source.

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.

What is the difference between ASP.NET and ASP.NET MVC?

I'm a complete beginner when it comes to ASP.NET but I want to learn it in order to build a web application that eventually will communicate with a cloud hosted SQL server. However, I cannot find any information that outlines the difference between ASP.NET web application and ASP.NET MVC2 web application (in visual studio 2010) so I'm not sure where to start. Can anyone give me a simple explanation/outline so I can decide on a tutorial to follow?
Thanks
ASP.NET is a web platform. It provides a layer that sits on top of IIS (the web server) which facilitates the creation of web applications and web services. ASP.NET MVC is a framework specifically for building web applications. It sits ontop of ASP.NET and uses APIs provided by ASP.NET. ASP.NET Web Forms is another framework specifically for building web applications, and the new ASP.NET Web API is a platform for building web services.
ASP.NET, at its most basic level, provides a means for you to provide general HTML markup combined with server side "controls" within the event-driven programming model that can be leveraged with VB, C#, and so on. You define the page(s) of a site, drop in the controls, and provide the programmatic plumbing to make it all work.
ASP.NET MVC is an application framework based on the Model-View-Controller architectural pattern. This is what might be considered a "canned" framework for a specific way of implementing a web site, with a page acting as the "controller" and dispatching requests to the appropriate pages in the application. The idea is to "partition" the various elements of the application, eg business rules, presentation rules, and so on.
Think of the former as the "blank slate" for implementing a site architecture you've designed more or less from the ground up. MVC provides a mechanism for designing a site around a pre-determined "pattern" of application access, if that makes sense. There's more technical detail to it than that, to be sure, but that's the nickel tour for the purposes of the question.
Good luck!
ASP.NET MVC2 web application is based on MVC pattern in order to facilitate unit test, without mocking pipeline asp.net, because it's very difficult. you don't have code on Code Behind in order to separate your code graphic and your code functional.
With MVC your application become independent from view. you can replace easily technology of creating view.
Read this article it's very interesting : http://msdn.microsoft.com/en-us/magazine/dd942833.aspx
If you have VS10 make a small ASP.NET (webforms) application and a small ASP.NET MVC 2 application, and examine the differences between them. It's a great way to learn.
A very good material is available here
http://www.webdevelopmenthelp.net/2013/10/Difference-between-ASP.NET-WebForm-And-ASP.NET-MVC.html
Like ASP.Net web forms, ASP.Net MVC is development model to build web application in Microsoft .net framework. The major difference between them are ASP.net MVC is based on the MVC architecture. Where we have 3 independent tiers – Model, View Controllers which interact which each other to render HTML output.
Major differences
Web forms is mainly has an event driven model. Where we have page level events(Page_load, pre render, page_init etc) and control level events. Which is not the case for MVC. The request life cycle is comparatively complex.(why complex because, the request has to goes through all the events before rendering the HTML output )
Web forms is basically has an aspx page which contains UI controls and a code behind file. All the page level events and control level events are handled here. In MVC the View, Model , controller can exist independently (gives clear separation of concern)
The SOC makes it easier for development as we can have separate developers for View(design html) and controller (implement business logic)
Because of this tight coupling nature, web forms are not suitable for unit tests. In MVC we can write unit tests at both controller level, action method levels. Here we can mock the data to be passed to view and do assert the result from the action method for their different properties like view name, model properties, null check etc
In web forms we have state full behavior. The server controls in ASPX page uses view state to retain their state during request response cycle. Since this view states are stored as hidden controls inside the page itself, and they are sent during request and response cycle, it makes them more heavy. Absence of view state and state less nature of MVC make it more light weight. Hence they are much more faster in request lifecycle.
ASP.NET is a web platform. It provides a layer that sits on top of the web server which facilitates the creation of web applications and web services. ASP.NET is a framework specifically for building web applications. It sits of ASP.NET and uses APIs provided by ASP.NET. ASP.NET Web Forms is another framework specifically for building web applications, and the new ASP.NET Web API is a platform for building web services
ASP.NET is a 2 tier application in which no separate section for the database and MVC is a 3 tier application in which view and logic is kept separate.
In ASP.NET for each .aspx form one URL is generated, but in MVC the url's are generated based on the controller and by the router configuration.

What is the vantage of asp.net mvc?

What is the vantage of asp.net mvc?
How can I migrate from asp.net to asp.net mvc?
You have to realize that it's a completely different model to that of ASP.NET WebForms. The one doesn't replace the other.
From the ASP.NET MVC Site
Provides complete control over your
HTML markup
Enables rich AJAX integration
Intuitive website URLs
Clear separation of concerns which
results in web applications that are
easier to maintain and extend over
time.
Testability – including support for
test-driven development.

Resources