---
title: "how to use session in asp.net"  
description: "how to use session in asp.net"  
author: "Anonymous User"  
published: 2013-01-05  
updated: 2013-01-05  
canonical: https://www.mindstick.com/forum/526/how-to-use-session-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# how to use session in asp.net

Hi,\
\
I want to use [Session](https://www.mindstick.com/articles/12042/session-in-c-sharp) in C# [class Library](https://www.mindstick.com/forum/158577/what-is-the-significance-of-the-base-class-library-bcl-in-the-dot-net-framework). For that I need to [import](https://www.mindstick.com/blog/294/how-to-import-or-export-sql-server-table-data-in-ms-excel-sheet-using-c-sharp-code) Using System.Web.UI. My [partial](https://www.mindstick.com/blog/78/partial-class-in-dot-net) [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) is\
using System.IO;\
using System.Globalization;\
using System.Web\
[namespace](https://www.mindstick.com/articles/12552/namespace) sundss_framework\
{\
[public](https://www.mindstick.com/blog/11097/java-access-modifiers-the-public-and-the-private-modifiers) class [package](https://www.mindstick.com/blog/12619/tips-for-finding-the-right-package-when-you-buy-instagram-followers)\
{\
Session["ID"]="12121";\
}\
}\
\
Thank in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by AVADHESH PATEL

Hi Ashish Paney\
\
You don't need System.Web.UI, just System.Web. \
\
Then access the session like:\
\
HttpContext.Current.Session["IDl"]="12121";


---

Original Source: https://www.mindstick.com/forum/526/how-to-use-session-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
