Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    aryaxt's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Mar 2009
    Posts
    16
    Downloads
    0
    Uploads
    0

    ASP.Net ==> Sessions ?!?!?

    on my first page i create a session
    SessionData sd = new SessionData("username" , 2);
    Session.Remove("sessionData");
    Session.Add("sessionData", sd);

    on my second page
    SessionData sd = (SessionData) Session["sessionData"];
    but the username and id that i entered on the first page are not saved
    instead of "username" i get ""
    instead of 2 i get 0

    Here is the code for SessionData class
    public class SessionData
    {
    public string username;
    public int id;
    public SessionData (string username, int id)
    {
    this.username = username;
    this.id = id;
    }
    }

    Any idea why I'm losing this data?
    NVM I FIXED IT
    I was missing some lines of code

  2. #2
    Sun's Avatar
    Member

    Status
    Offline
    Join Date
    May 2009
    Posts
    40
    Downloads
    0
    Uploads
    0
    lol @ the PHP fanboys who troll this area ^^^^

    They are all clueless.

 

 

Quick Reply Quick Reply

Click here to log in


How many letters in the word Rabroad

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. maintaining sessions in asp.net 2.0?
    By spidy_kane in forum Discuss ASP
    Replies: 0
    Last Post: 07-23-2010, 02:50 PM
  2. Replies: 1
    Last Post: 12-06-2009, 10:39 PM
  3. Replies: 0
    Last Post: 12-01-2009, 07:41 AM
  4. Replies: 1
    Last Post: 11-14-2009, 02:14 PM
  5. C# ASP Sessions Question?
    By Ryan in forum Discuss ASP
    Replies: 1
    Last Post: 01-26-2009, 04:11 AM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •