Aillyn
Aillyn

Reputation: 23793

Questions about ASP.NET

I want to get start on ASP.NET, but I have a few questions:

  1. How are C# and ASP.NET related?
  2. Is it true that I don't have full control over the output, unlike in PHP and Python?
  3. How easy is it to create code that is compatible with .NET 2.0, 3.5 and 4.0?

Added questions:

  1. I've heard ASP.NET pages are compiled. Is that why it makes no difference whether I use C# or VB.NET? I only need something that can compile targetting the .NET platform?
  2. Can I intermingle VB.NET and C# in my pages?

Upvotes: 2

Views: 160

Answers (4)

Jarek
Jarek

Reputation: 5935

  1. C# is a programming language and ASP.Net is a technology that you use to create web appliactions. ASP.Net applications can be written in C# and VB.Net languages (and maby IronPython, but I'm not sure).
  2. If you're using asp.net controls you don't have full control over the output, some HTML will be rendered if you want it or not (it depends on control's implementation)
  3. You can write everything using .Net 2.0 and it will be compatible with the next versions of .Net :) But as far as I know there were only minor changes in CLR in .Net 3.0 and 3.5, .Net 4.0 has much more changes.

Added questions: I think everyting you want to know is here: http://msdn.microsoft.com/en-us/library/ms178466.aspx :

In order for application code to service requests by users, ASP.NET must first compile the code into one or more assemblies. Assemblies are files that have the file name extension .dll. You can write ASP.NET code in many different languages, such as Visual Basic, C#, J#, and others. When the code is compiled, it is translated into a language-independent and CPU-independent representation called Microsoft Intermediate Language (MSIL). At run time, MSIL runs in the context of the .NET Framework, which translates MSIL into CPU-specific instructions for the processor on the computer running the application.

Multiple Language Support In ASP.NET 2.0 you can use different languages such as Visual Basic and C# in the same application because ASP.NET will create multiple assemblies, one for each language. For code stored in the App_Code folder, you can specify a subfolder for each language. For more information on the App_Code folder, see Shared Code Folders in ASP.NET Web Projects.

Upvotes: 3

aepheus
aepheus

Reputation: 8187

  1. I think of ASP.net as a toolkit, which is used in conjunction with a programming language (like C# or VB.net). It's a toolkit specific to web development.

  2. You can have as little, or as much control as you like. ASP.net offer controls, which trade simplicity for control, they basically generate markup. You can also do everything programmatically, similar to PHP.

  3. Like mentioned, .net is backwards compatible, so if you program 2.0, it will be compatible with following versions. That said, you will usually have control over your version, and the later versions have nicer features.

Upvotes: 0

quentin-starin
quentin-starin

Reputation: 26628

  1. ASP.Net is what I would call a technology stack. It's all the bits and pieces (classes) that provide an API and framework upon which to build websites. In order to build those websites we have to implement functionality - all the various pages in a website, etc. - and we can implement that functionality using any language that targets the .Net Framework. C# is one of those languages.

  2. You can definitely have full control over the output. At a bare minimum, you can simply output bytes to the response stream. That's about as bare as it gets. With ASP.Net MVC, the default is to have nearly complete control over the output. With WebForms in ASP.Net, much of the output is generated by the WebForms controls, and I would say that output is "ugly" underneath the covers.

  3. The .Net Framework has a history of maintaining backwards compatibility. Anything written for .Net 2.0 will run under any later version. Even code written against v3.5 will often run on the 2.0 Framework - many of the features added in 3.5 are compiler features - they only need to be compiled with a newer version and then they can run on the older 2.0 Framework.

Upvotes: 0

El Ronnoco
El Ronnoco

Reputation: 11922

1) C# is one of the languages in which you can develop the code-behind for an ASP.NET website. VB.net is the other.

2) The 'output' will be viewed in a web browser and so rendering is browser dependent.

3) Code in C# or VB.Net will be compatible with the .NET framework in which it was developed and much of the code in 2.0 can easily be ported to 3.5 +

http://en.wikipedia.org/wiki/ASP.NET

Upvotes: 1

Related Questions