Hello Any Body is there to solve it plz

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dhanu sahu
    New Member
    • Mar 2008
    • 14

    Hello Any Body is there to solve it plz

    Hi all,

    I am transfering value to 2nd page


    Page 1.

    Session ["usid"]=Empid.ToString ();
    Session["userid"] = EmployeeName;
    Response.Redire ct("membermain. aspx" );

    2nd page
    public string WelcomeName;
    if (Session["userid"].ToString () !="" )
    {
    Response.Redire ct("Default.asp x");
    }
    WelcomeName = Session["UserID"].ToString ();

    }



    Showing Error:

    Object reference not set to an instance of an object.

    Nullvalueexcept ion unhandale
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by dhanu sahu
    Hi all,

    I am transfering value to 2nd page


    Page 1.

    Session ["usid"]=Empid.ToString ();
    Session["userid"] = EmployeeName;
    Response.Redire ct("membermain. aspx" );

    2nd page
    public string WelcomeName;
    if (Session["userid"].ToString () !="" )
    {
    Response.Redire ct("Default.asp x");
    }
    WelcomeName = Session["UserID"].ToString ();

    }



    Showing Error:

    Object reference not set to an instance of an object.

    Nullvalueexcept ion unhandale
    To test for null do
    if(Session["userid"] != null)

    Shouldn't your names be exactly the same (including case) in both pages?

    Comment

    Working...