C# is the programming language. Like Javascript, Java, C, PHP, etc. It allows you to write code that will be, one way or another, executed by the computer. There is a specific syntax and semantics defined in specification and implemented in a compiler.
This language was created to be used on top of a specific platform called CLR, which is a virtual machine. It’s software that simulates a computer and has its own rules of operation. With it it is possible to control better what the software that runs on it does. It’s easier to port code to real physical platforms (other processors and computer architectures). With CLR it is easier to produce reliable and flexible code and more security is possible. Languages running on top of CLR compile to a common assembly language called CIL.
CLR normally runs on a framework called .NET, created by Microsoft. But it can run on other compatible ones, such as Mono, for example. Today there are several versions of. NET, each one with its peculiarity to better meet the needs of the developer and user of the end application (but is everything being unified in one thing only). Beyond the Runtime which controls the virtual machine, the garbage collector and other functions of the platform, there are libraries and subframeworks where you find the various algorithms and data structures used by C#. Some of these frameworks internal or accessories to . NET are quite complex and despite performing specific tasks, are quite large.
This framework cannot be confused with the programming language. Of course C# has been used to write most of it and it is necessary for the language to work, but they are different things, despite their interdependence.
Knowing what a framework it’s easier to understand what the ASP.NET. It is a set of codes that perform a specific task in an integrated way. He is responsible for manipulating web pages on .NET. There are classic ASP.NET variations (or Webforms) and the ASP.NET MVC which is more modern and currently preferred by most developers.
Other frameworks are used for other tasks, including access to desktop there are competitors within the . NET itself, such as the Winforms, WPF and Winrt, each with its own characteristic.
We have seen that ASP.NET is just a technology used in the ecosystem of the platform commonly called .NET. It cannot be confused as a programming language, as many do. It has no syntax of its own. Although both classic ASP.NET and ASP.NET MVC have classic syntax Engines rendering pages that have a code markup and embedding syntax, such as Razor.
ASP is a technology for creating web pages created by the existence of .NET. It should no longer be used for a number of reasons, but mainly because it does not have full support by the vendor, Microsoft.
It is often called classic ASP to not confuse with ASP.NET, since confusion is common.
Among the many limitations:
- the ASP uses the Visual Basic ancient in scripts not compiled, pre-VB.NET and does not allow another language, as in . NET that allows, in thesis, any language supported in CLR
- several improvements in error handling, events and other programming techniques, such as cache, are not available
- the number of libraries available is much more limited and those that exist do not have the same quality
- development methodology considered obsolete and difficult to maintain
- there are conceptual problems, memory manipulation and session control
I strongly advise to accompany all links above and if possible see the English pages of Wikipedia that are better. From there continue following the links more relevant. There is much to learn.
Everything becomes kind of obsolete. We’re talking about outdated technologies, has a link above that shows the modern way of what must follow now.
How can it be the same C# on desktop and web? By chance on the Web I can add label, panel, textbox as in desktop version? Are there forms? I can’t understand...
– Latrova
@Lizard No, not exactly. Asp.Net has a Web Forms Framework that allows you to work in a similar way to Windows Forms (which gives you the illusion of being able to add Label, Button, Textbox, etc.). What I mean by "It’s always the same C#" is because the language is the same, but it changes the library. For desktop, for example, you use the System.Windows.Forms library, while for Asp.Net Web Forms, you use the System.Web.UI library.
– André Leria
I think I got it, just open my mind... If it’s web, it works with HTML, right? Finally, I adding a textbox, what effect does this textbox have (in this web Forms you commented on) in html code?
– Latrova
The Textbox of Web Forms is an "abstraction". That is, it is a kind of "illusion". Pro C#, it is a Textbox. Since Asp.Net knows that Html does not know what a Textbox is, Asp.Net transforms all its Textbox into a Textbox
<input type="text" />
when "render" the client page.– André Leria
I understood, he also does this about positioning and with all other C controls#?
– Latrova
Web Forms does not have ALL the controls of Windows Forms, but it has most, which behave similarly. The intention of Web Forms is to bring web development as close as possible to desktop development with Windows Forms. Still, it doesn’t stop you from using pure HTML, Javascript and CSS, so when it doesn’t meet some need for your positioning or style, you can adjust as you like.
– André Leria
As a note, I must say that the level of abstraction presented by Web Forms is harmful. The fact is that Microsoft tried to embellish this framework so much that it became heavy (for reasons of Viewstate, Postback and the like). And as a personal experience, I say that doing something that Web Forms does not provide in principle can become a great pain. I recommend that, if you want to do Web development with C#, use the MVC Framework, also official Microsoft and with more active development since a long time.
– André Leria