Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8741087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:14:46+00:00 2026-06-13T11:14:46+00:00

I followed this post: DataTable using Server Side Processing . Inside default.aspx , I

  • 0

I followed this post:DataTable using Server Side Processing.
Inside default.aspx, I am calling .ashx using:

<script type="text/javascript">
$(function () {
    $('#example').dataTable({
        'bProcessing': true,
        'bServerSide': true,
        'sAjaxSource': '/data.ashx'
    });
});

On Page_Load event of defaut.aspx:

Employee emp=new Employee();
emp.name="abc";
emp.addr="pqr";
emp.phone="123";

Where Employee is the name of Class.
How can I pass the Employee Object to Data.ashx?

I tried using HttpContext.Current.Session but is shows Session object as null.
Please Help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:14:46+00:00Added an answer on June 13, 2026 at 11:14 am

    To Access the session Inside I used IRequiresSessionState interface as below:

    public class Data : IHttpHandler, System.Web.SessionState.IRequiresSessionState
    {
         public void ProcessRequest(HttpContext context)
         {
             // get Employee object from session here
             Employee emp =(Employee)HttpContext.Current.Session["employee"];
         }
    }
    

    Ofcourse to set an Employee object in session, on Page_Load event of defaut.aspx:

    Employee emp=new Employee();
    emp.name="abc";
    emp.addr="pqr";
    emp.phone="123";
    
    HttpContext.Current.Session["employee"]=emp;
    

    NOTE:
    There are two interfaces present to make access available to HttpSession in Generic Handler:

    1. IRequiresSessionState
      Using this interface we can read and write the session variables.

    2. IReadOnlySessionState
      Using this interface we can only read and cannot write or edit the session variables.

    For more information check this link: IRequiresSessionState vs IReadOnlySessionState

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed this post: DataTable: Server Side Processing in ASP.Net I am using this
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I followed the directions in this post: how can we integrate jquery autocomplete using
This is my first time using authentication library. I followed this post to install
I followed this post to make my section header animate out of view when
I followed the instructions in this post and this fiddle but I am confused
I'm trying to upgrade to Node v0.6.17. I followed the instructions in this post:
I followed this video tutorial for detecting memory leaks using Instruments with Xcode 4.3.2.
I hate starting a post with this but I'm new to Java... I've followed
I read this post: What is the easiest-to-use web "rich text editor" and followed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.