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

  • SEARCH
  • Home
  • 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 8995743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:39:37+00:00 2026-06-15T23:39:37+00:00

I have a frustrating issue when trying to pass a custom object from 1

  • 0

I have a frustrating issue when trying to pass a custom object from 1 page of a web site to another. When I try to use the object from session on the page 2 it is null. I believe that my syntax is correct as when I take the code out of my larger solution and run it on it’s own it works fine.

I am wondering if there are any settings in visual studio, aspx files, project properties that may be set on my project that may be causing this session object not to work?

Simplied syntax that I am using is;
on page1

Person p = new Person;
p.name = "john"; 
p.secondName = "doe";
Session["person"] = p.
Response.Redirect("Page2.aspx")

Page 2 on page load method

Person p = (person)Session["person"]
textbox1.Text = p.name;
textbox2.Text = p.Secondname;

As I said this code works fine on it’s own but not as part of my larger works project. Any ideas on why this may not be working would be greatly appreciated

  • 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-15T23:39:38+00:00Added an answer on June 15, 2026 at 11:39 pm

    There are three possible options.

    First one is that inside your larger project session state is disabled. Please visit Turn Off ASP Session State in Active Server Pages and IIS for more details.

    Second option would be that exception occurs somewhere inside your application (separate thread) resulting in application restart and session state loose. You can check this by hooking to Application error inside Global.asax like this:

        void Application_Error(object sender, EventArgs e)
        {
            Exception ex = Server.GetLastError();
        }
    

    The last option would be that session[“person”] value is changed in other module or page.

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

Sidebar

Related Questions

I am having a rather frustrating issue trying to call a web service that
I have a widget which I am trying to use to display information from
I have a really frustrating issue where I cannot retrieve any of the headers.
I'm facing a frustrating issue. I have an application where the scroll wheel doesn't
Okay so I have encountered a frustrating issue with namespaces. I am currently using
I have a frustrating issue that my app on Google Appengine throws NullPointerException like:
This is becoming a very frustrating issue. I am trying to do a clean
I've hit a very frustrating issue with one of my apps. I have a
Hope someone can help with a bit of a frustrating issue. I have a
I have come across really frustrating issue related to Unicode text and I am

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.