ASP.NET Fundamentals

ASP.NET Fundamentals covers basic topics of ASP.NET Framework such as Session, Cookie, HTTP Handler, HTTP Module, Forms Authentication, Caching, Exception Handling, ASP.NET Request Processing etc.

What is ASP.NET?

ASP.NET is a framework developed by Microsoft to build dynamic web applications. There are two programming models to develop web applications using ASP.NET.

  1. ASP.NET Web Forms

Both programming models use ASP.NET on the top of that.

ASP.NET is also a part of Microsoft's .NET Framework. We can write ASP.NET Applications code in any .NET Framework supported language i.e. C#, J#, F#, VB etc.

ASP.NET applications can only be hosted under IIS Server which is available on Window Operating Systems only.

Microsoft has now moved it's further development from this traditional .NET Framework (Windows only) to new .NET Core, which is Cross Platform (supporting Windows, MAC OS, and Linux) framework to develop software applications i.e. Desktop, Web, Console, Mobile Applications.

What is Session in ASP.NET?

Sessions are basically server variables that are used to store information on Server.

Session in ASP.NET enables you to store information on server & access that stored information on your sub-sequent web-requests.

HTTP is a stateless protocol, it means every web-request is a new web-request in itself. It does not hold or preserve previous request data. So, Sessions provides us a way to identify the user from on the subsequent web requests.

How to set a value in session in C#:

 Session["Email"] = "";

How to retrieve the stored value from the session:

 string email = Convert.ToString(Session["Email"])

I have covered only basics. You should also study below advanced topics related to Session:

  • Session Identifier
  • Session State Modes

What is Cookie in ASP.NET?

An HTTP Cookie is a piece of data that is stored on the user's browser. Whenever you make a web-request, all the cookies associated with the domain are sent with the web- request.

On the server, we can access those cookies & read values from them. Hence, cookies help us in maintaining state by storing data on client's machine.

You can add a cookie in ASP.NET in following way:

 Response.Cookies.Add(new HttpCookie("Email", ""));

To read the cookie, you can use below syntax:

string email = Convert.ToString(Request.Cookies["Email"]);

What is State Management in ASP.NET? Explain various techniques available for State Management in ASP.NET?

State Management is a technique in ASP.NET to maintain states. There are following ways in ASP.NET to maintain states:

Server Side

  1. Session
  2. Application

Client Side

  1. Cookies
  2. Query String
  3. View States
  4. Hidden Fields

Difference between Response.Redirect() and Server.Transfer() ?


Explain different Authentication Modes available in ASP.NET?


What is an HTTP Handler in ASP.NET?

Explain in detail what is it? When can we make custom one? Why to use it?

What is an HTTP Module in ASP.NET?


What is Worker Process or w3wp.exe?


What is a Worker Thread?


This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. For more information - please visit our private policy.