.NET is a software framework/infrastructure developed by Microsoft used to develop, run, and deploy the applications like console applications, window services, web services and web applications. ASP.NET is a web application of .NET framework that is used to build dynamic web pages. Therefore the difference lies in the ASP.NET as it is specially catering to web applications whereas .NET can support both console and web applications. Common Language Runtime is an important component of .NET, which is used to provide a language-neutral platform and also performs tasks like memory management, exception handling, debugging, code safety and compilation. .NET framework’s Class Library contains numerous reusable classes, interfaces etc; collectively known as types. Common Type System of the framework defines how types are declared, used and managed during runtime. It also supports cross language integration. All .NET source code is compiled into an intermediate language also known as IL and then IL gets converted to machine code. .NET framework provides advantages like-
1.It provides a consistent object oriented programming infrastructure.
2.Software Deployment is minimized and also versioning problems.
3.Consistency in developing window and web based applications.
4.Promotes safe execution of code
.NET framework has moved application development to server centric rather than client centric. Due to CLR many languages work as .NET languages but on the condition provided that they must follow rules and standards set by CLR.
ASP.NET is an evolution from ASP. ASP.NET uses .NET languages like C#, C++, Jscript.NET, VB.NET etc to create HTML pages. .NET supports both client side and server side development and ASP.NET provides extensible server side control architecture and server side data binding model. ASP.NET can also be called as collection of .NET classes that process an HTTP request and then generate HTTP response. ASP.NET is built on .NET framework thus any .NET programming language can be used. When an instance of the page is created, an event called as the PreInit occurs first, it invokes method Page_PreInit, used to set the theme of the page. The Init event occurs next, invoking method Page_Init, it initializes objects of the page. Then, the Load event occurs, and the Page_Load event handler executes. The Init event is raised only one time that is first time the page was requested. The Load event gets raised whenever a request is made. Response is given and then, an Unload event occurs, which calls Page_Unload, which typically free resources used by the page.