Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple plain ASP.NET application example (without Web Forms and MVC)

Tags:

asp.net

For many developers ASP.NET and ASP.NET Web Forms are the same things. For some time I've been using Web Forms, but recently I learned that Web Forms is only build on top of ASP.NET. I become more curious how does a simple plain ASP.NET application look like. I learned about 3 ASP.NET programming models: Web Forms, Web Pages and MVC (Here Scott Hanselman explains briefly the differences). But it still seams that all the 3 approaches sits on top of ASP.NET.

I was trying to find an example application which uses pure ASP.NET, but I couldn't find anything.

I started to dig deeper into source code of ASP.NET web page and I found out that each web page is actually HTTP Handler (each page implements IHTTPHandler interface). Does it mean that pure ASP.NET application would be just a HTTP Handler implementation? Or am I missing something.

In my understanding ASP.NET Web Forms correspond to Win Forms in desktop world. But in the desktop world you can still write console application which doesn't use Win Forms. So what is an equivalent of console application in the web world?

Any comments or references appreciated. Thanks in advance.

like image 688
Lukasz Lysik Avatar asked Sep 01 '13 23:09

Lukasz Lysik


People also ask

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

Asp.Net Web Form has built-in data controls and best for rapid development with powerful data access. 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 an interactive web application with the latest web standards.

Is MVC only for web apps?

MVC or Model View Controller happens to be an architecture design pattern, which is utilized for reusable and maintainable user interfaces as well as web development. MVC architecture is also utilized for other applications.

Is MVC easier than web forms?

MVC is a pattern based on separation of concerns, which means that View, Model and Controller are independent of each other. As a result, working in teams, maintenance and testing of the application become simpler and easier.


1 Answers

ASP.NET is a very broad set of technologies, and it includes WebForms.. and as of MVC5, it also includes MVC, WebApi and WebPages. This is what Microsoft is now calling the "One ASP.NET" initiative.

These are all part of ASP.NET, just like ASP.NET is part of .NET. These are all just layers. There is no 'seperate' part called asp.net that does not contain these pieces (and even in earlier versions, there was no version of asp.net that did not include WebForms).

As such, there's no such thing as a "pure asp.net" app. You can certainly write an app that does not use WebForms (which means no .aspx or ascx or .master files, no Server Controls of any kind... essentially anything that exists in the System.Web.UI namespace.)

At most, you could consider this whatever is in the System.Web namespace (without any further levels of namespaces. Essentially what's here http://msdn.microsoft.com/en-us/library/system.web.aspx )

So that would be things like the Request object, the Response object, Cookie handling, Membership, FormsAuthentication, etc... This is basic plumbing that isn't all that useful by itself. You would have to write a presentation framework of your own to sit on top of it.

There are other frameworks out there, such as FubuMVC, Nancy, MonoRail, etc... these are just like MVC or WebForms or WebPages... using the basic ASP.NET classes to do their job.

like image 132
Erik Funkenbusch Avatar answered Nov 30 '22 00:11

Erik Funkenbusch