HOW TO USE SESSION IN ASP.NET

Ashish Pandey

Total Post:128

Points:898
Posted by  Ashish Pandey
 1460  View(s)
Ratings:
Rate this:
Hi,

I want to use Session in C# class Library. For that I need to import Using System.Web.UI. My partial code is
using System.IO;
using System.Globalization;
using System.Web
namespace sundss_framework
    {
        public class package
        {
           Session["ID"]="12121";
        }
    }

Thank in advance
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: how to use session in asp.net

    Hi Ashish Paney

    You don't need System.Web.UI, just System.Web.

    Then access the session like:

     HttpContext.Current.Session["IDl"]="12121";

      Modified On Jan-05-2013 07:02:02 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!