Best Practice for Login Screen Using a Table form a Database

Discussion in 'ASP .Net' started by Carlos, Feb 18, 2005.

  1. Carlos

    Carlos Guest

    I have an c# as.net app that check if the user exist in a USERS table, that
    part is ok but now I need to pass the user ID no the next page beacuse I
    need to do some databse queries with that user ID, I'm passing the values as
    :
    Context.Items.Add("UserID",TempUserID);
    Context.Items.Add("VerifyString","OkPEV");
    Server.Transfer("timesheet.aspx", true);

    Now my problem is that in the timesheet.aspx page ths UserID come fine the
    first time, but if I do refeesh or add a record to my timesheet databse I
    loose the UseID.

    So is it any way to keep that variable on memmory while the session is open
    ?

    Thanks
     
    Carlos, Feb 18, 2005
    #1
    1. Advertising

  2. Storing items in the Session object should do it

    Session("UserID") = TempUserID
    ....

    That holds the variable as long as that current browser window is open

    "Carlos" wrote:

    > I have an c# as.net app that check if the user exist in a USERS table, that
    > part is ok but now I need to pass the user ID no the next page beacuse I
    > need to do some databse queries with that user ID, I'm passing the values as
    > :
    > Context.Items.Add("UserID",TempUserID);
    > Context.Items.Add("VerifyString","OkPEV");
    > Server.Transfer("timesheet.aspx", true);
    >
    > Now my problem is that in the timesheet.aspx page ths UserID come fine the
    > first time, but if I do refeesh or add a record to my timesheet databse I
    > loose the UseID.
    >
    > So is it any way to keep that variable on memmory while the session is open
    > ?
    >
    > Thanks
    >
    >
    >
    >
    >
    >
    >
    >
    >
     
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=, Feb 18, 2005
    #2
    1. Advertising

  3. Carlos

    Carlos Guest

    Thanks that doit !!

    Carlos
    "Tampa .NET Koder" <> wrote in
    message news:...
    > Storing items in the Session object should do it
    >
    > Session("UserID") = TempUserID
    > ...
    >
    > That holds the variable as long as that current browser window is open
    >
    > "Carlos" wrote:
    >
    >> I have an c# as.net app that check if the user exist in a USERS table,
    >> that
    >> part is ok but now I need to pass the user ID no the next page beacuse I
    >> need to do some databse queries with that user ID, I'm passing the values
    >> as
    >> :
    >> Context.Items.Add("UserID",TempUserID);
    >> Context.Items.Add("VerifyString","OkPEV");
    >> Server.Transfer("timesheet.aspx", true);
    >>
    >> Now my problem is that in the timesheet.aspx page ths UserID come fine
    >> the
    >> first time, but if I do refeesh or add a record to my timesheet databse I
    >> loose the UseID.
    >>
    >> So is it any way to keep that variable on memmory while the session is
    >> open
    >> ?
    >>
    >> Thanks
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
     
    Carlos, Feb 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan Ax
    Replies:
    0
    Views:
    625
    Bryan Ax
    Jun 26, 2003
  2. =?Utf-8?B?RXJpY2g=?=

    Best Practice for login systen with asp.net

    =?Utf-8?B?RXJpY2g=?=, Feb 5, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    736
    Lucas Tam
    Feb 6, 2005
  3. Carlos

    Best practice for login screen using database

    Carlos, Feb 18, 2005, in forum: ASP .Net Security
    Replies:
    2
    Views:
    130
    Garry
    Mar 28, 2006
  4. Colin Graham

    Login to admin system through login screen only

    Colin Graham, Apr 10, 2005, in forum: ASP .Net Security
    Replies:
    1
    Views:
    282
    Joseph MCAD
    Apr 11, 2005
  5. oldyork90
    Replies:
    1
    Views:
    177
    Jeremy J Starcher
    Sep 10, 2008
Loading...

Share This Page