Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. remember me

remember me

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jai 123
    wrote on last edited by
    #1

    hi, i designed a login page in asp.net with C#, in that i want to save the username and password in the local computer,if the user select the remember me in the computer checkbox means, the username and password must save in that computer. plz help me.

    jai prakash

    S K 2 Replies Last reply
    0
    • J jai 123

      hi, i designed a login page in asp.net with C#, in that i want to save the username and password in the local computer,if the user select the remember me in the computer checkbox means, the username and password must save in that computer. plz help me.

      jai prakash

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Hey i have answered the same question below.

      Regards, Satips.:rose:

      1 Reply Last reply
      0
      • J jai 123

        hi, i designed a login page in asp.net with C#, in that i want to save the username and password in the local computer,if the user select the remember me in the computer checkbox means, the username and password must save in that computer. plz help me.

        jai prakash

        K Offline
        K Offline
        kumarjammula
        wrote on last edited by
        #3

        Take a checkbox in the login page i had used Logincontrol of asp.net2.0 CheckBox chkBox = (CheckBox)Login1.FindControl("RememberMe"); if (chkBox.Checked==true) { HttpCookie myCookie = new HttpCookie("myCookie"); //Instance the new cookie Response.Cookies.Remove("myCookie"); //Remove previous cookie Response.Cookies.Add(myCookie); //Create the new cookie myCookie.Values.Add("user", this.Login1.UserName); //Add the username field to the cookie DateTime deathDate = DateTime.Now.AddDays(1); //Days of life Response.Cookies["myCookie"].Expires = deathDate; //Assign the life period myCookie.Values.Add("pass", this.Login1.Password); } Getting after Cookie created u write the code in page load event.... if (Request.Cookies["myCookie"] != null) //Cookie Exists?? { HttpCookie cookie = Request.Cookies.Get("myCookie"); string user = cookie.Values["user"].ToString(); if (user != "") { Login1.UserName = user; //Write the username onto login username textbox } }

        came out of hardwork

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups