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. cookies in .net

cookies in .net

Scheduled Pinned Locked Moved ASP.NET
csharp
5 Posts 3 Posters 1 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.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi want to go for cookie concept..., When my user click a button a cookie have to save..., after that if he click once agian another cookie also want to save with already existed cookie..., and finally i want to get all the cookies..., plz give me some idea reg this...,

    Thanks & Regards, Member 3879881, please don't forget to vote on the post

    P 1 Reply Last reply
    0
    • M Member 3879881

      Hi want to go for cookie concept..., When my user click a button a cookie have to save..., after that if he click once agian another cookie also want to save with already existed cookie..., and finally i want to get all the cookies..., plz give me some idea reg this...,

      Thanks & Regards, Member 3879881, please don't forget to vote on the post

      P Offline
      P Offline
      padmanabhan N
      wrote on last edited by
      #2

      i am using 2 textboxes and a checkbox and button: //code for aspx.cs page: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HttpCookie coo = Request.Cookies["Info"]; if (coo != null) { txtfirst.Text = coo["name"]; txtsecond.Text = coo["name1"]; } } } protected void Button1_Click(object sender, EventArgs e) { if (CheckBox1.Checked == true) { HttpCookie cook = new HttpCookie("Info"); cook["name"] = txtfirst.Text.ToString(); cook["name1"] = txtsecond.Text.ToString(); cook.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(cook); } } //Add this line in web.config. < sessionState cookieless="UseCookies" />

      Padmanabhan My Articles[^]

      J M 2 Replies Last reply
      0
      • P padmanabhan N

        i am using 2 textboxes and a checkbox and button: //code for aspx.cs page: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HttpCookie coo = Request.Cookies["Info"]; if (coo != null) { txtfirst.Text = coo["name"]; txtsecond.Text = coo["name1"]; } } } protected void Button1_Click(object sender, EventArgs e) { if (CheckBox1.Checked == true) { HttpCookie cook = new HttpCookie("Info"); cook["name"] = txtfirst.Text.ToString(); cook["name1"] = txtsecond.Text.ToString(); cook.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(cook); } } //Add this line in web.config. < sessionState cookieless="UseCookies" />

        Padmanabhan My Articles[^]

        J Offline
        J Offline
        Jack Li
        wrote on last edited by
        #3

        great!

        P 1 Reply Last reply
        0
        • J Jack Li

          great!

          P Offline
          P Offline
          padmanabhan N
          wrote on last edited by
          #4

          welcome :) :) :)

          Padmanabhan My Articles[^]

          1 Reply Last reply
          0
          • P padmanabhan N

            i am using 2 textboxes and a checkbox and button: //code for aspx.cs page: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HttpCookie coo = Request.Cookies["Info"]; if (coo != null) { txtfirst.Text = coo["name"]; txtsecond.Text = coo["name1"]; } } } protected void Button1_Click(object sender, EventArgs e) { if (CheckBox1.Checked == true) { HttpCookie cook = new HttpCookie("Info"); cook["name"] = txtfirst.Text.ToString(); cook["name1"] = txtsecond.Text.ToString(); cook.Expires = DateTime.Now.AddDays(1); Response.Cookies.Add(cook); } } //Add this line in web.config. < sessionState cookieless="UseCookies" />

            Padmanabhan My Articles[^]

            M Offline
            M Offline
            Member 3879881
            wrote on last edited by
            #5

            its not what i asked dera, i asked if cookie will be there with that new cookie also have to add like insert concept...,not update concept

            Thanks & Regards, Member 3879881, please don't forget to vote on the post

            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