views:

58

answers:

7

Aside from the rich array of controls (I know thats a big aside) what is the primary difference between say a C# application hosted on a web server that delivers HTML to a browser and an ASP.net solution. Lets say for this example, we include some javascript in the HTML to allow some client side processing - this makes the two methods even more similar, no?

I'm sure there are many conveniences with the ASP.NET way, but the core of "web server process interacting with client via HTML" is the same, true?

The reason I ask is, I'm presented with the need to deliver something along these lines and I don't know squat about ASP. NET....in case you haven't figured that out yet.

thanks.

+2  A: 

The difference is that it would take you 100x longer to write an application to serve HTML, repond to events, process postbacks, provide all of the functionality of ASP.NET etc., than it would take anyone to actually learn ASP.NET

If you know C# or VB.NET, picking up ASP.NET is very simple. As opposed to .NET MVC, which was designed for much lower level control, ASP.NET was designed as a medium to transfer developers over from winforms with very little resistance.

George
A: 

I know neither C# nor ASP.NET deeply, but in principle, it doesn't matter what you run on the server end. What comes out is a bunch of HTML and JavaScript instructions, and what goes back is feedback from the user, that is then processed. You can program this functionality in assembler or COBOL if you like.

The big difference in platforms is that ASP.NET and any other web specific development platform provides a plethora of pre-made tools to solve classic problems that arise when building a Web application - something basic C# does probably not have. (Update: @Dave Swersky lists a number of such classic problems in his answer.)

Pekka
+4  A: 

I think you may be under a misapprehension: I know of no practical way to write a non-ASP.NET C# application that runs on a webserver and delivers HTML to a browser. Note that I say practical way: you could write an HttpHandler or HttpModule that handles all of the interaction, but you'd be reinventing the wheel.

ASP.NET offers (not a complete list):

  • ViewState (automatic persistence of control state)
  • Authorization/Authentication mechanisms
  • Session and Application state
  • A "managed" page rendering lifecycle
  • Built-in "primitive" controls (textbox, dropdown, etc)
  • Base classes for custom server controls
  • User controls: i.e. Login.ascx (reusable "composite" controls)
  • An event model for postbacks
  • In-flight configuration (web.config) allows configuration changes while the app is running
Dave Swersky
+1  A: 

The largest difference is that what you are probably trying to do using straight C# is easy to do in ASP.Net written in C#. What I would recommend is to check out some of the tutorials found at http://www.asp.net/learn/ in order to get up to speed with ASP.Net before trying to reinvent the wheel. Remember, someone else will probably have to take care of the code if it's for a company and chances are they'll know asp.net but not your custom attempt at creating it from scratch.

JamesEggers
+1  A: 

There are really too many differences to give a good overview.

Here is the ASP.NET page on WikiPedia, which should give you a good overview of what ASP.NET is about.

In comparison to HTML, these are a couple of things off the top of my head:

  • You can't connect to a database with HTML
  • You can't create templates pages and change the content on the fly
  • A change to a set of related pages can be done in one place in ASP.NET, you will have to update a large amount of HTML pages to do the same thing.
Oded
A: 

If you will have multiple users of the application, go with ASP.NET. Not only will it be easier to roll out updates, but you'll also increase your skillset by getting exposed to programming for the web. ASP.NET isn't that difficult to pick up anyway. Especially if you're already familiar with WinForms programming. And besides, you've got SO when you're stumped.

Tim
A: 

There is also the possibility of there being no difference. One could create a "Web Application" in Visual Studio that uses ASP.Net and C# that delivers HTML to the client as a possible answer.

I would note that this implies a specific interpretation of what is meant by "C# application" as there are a few different ones that come to mind such as a Windows Application, Console Application and Web Application.

JB King