Pass session from profile to new page in

Total Post:39

 1086  View(s)
Rate this:
I know how to pass session from login page to user's profile but how to pass the same session from profile to new page
  1. Post:397

    Re: Pass session from profile to new page in

    Hi Andrew,

    By default, session variables are stored in the web server’s memory. You can receive session value from any page after creating. eg. from the login page if you redirect to any page, the code can be as follows:

    protected void cmdRedirect_Click(object sender, EventArgs e)
        Session["UserName"] = txtUserName.Text;

    Reading session value from Default.aspx:

    string LoginUser ="";
        LoginUser = Session["UserName"].ToString();

    Also, you can use the Membership class to get variables from the membership profile

    Session["MySessionDataVariable"] = Membership.GetUser().UserName


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.