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. CookieUrl Passing to iframe page [modified]

CookieUrl Passing to iframe page [modified]

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

    Hi Guys, wen i am clicking a link, i am storing the cookie value and redirecting to another page using script..., Eg: ---- click function test() { document.cookie="coktext=Hi~test"; window.location="testerpage.aspx"; } In that redirection TesterPage.aspx, I have a Iframe page (Page Name = Iframe_tester.aspx)..., In tht "TesterPage.aspx"...,Backend code i am getting the cookie value and passing the value to my iframe page using querystring..., Code: ------ TesterPage.aspx.cs if (Request.Cookies["coktext"] != null) { typepid = Request.Cookies["coktext"].Value; arrtypepid = typepid.Split('~'); if (arrtypepid[0].ToString().ToLower().Trim() == "hi") { partid = arrtypepid[1].ToString(); } else { partid = string.Empty; } } else { partid = string.Empty; } page front end: --------------- TesterPage.aspx Now my question is: -------------------- The iframe page not getting the partid value..., As per my code, i feel its correct..., Is there any mistake i have done? Is there any other way i can handle? Thanks & Regards, Member 3879881, please don't forget to vote on the post -- Modified Tuesday, March 23, 2010 5:03 AM

    P 1 Reply Last reply
    0
    • M Member 3879881

      Hi Guys, wen i am clicking a link, i am storing the cookie value and redirecting to another page using script..., Eg: ---- click function test() { document.cookie="coktext=Hi~test"; window.location="testerpage.aspx"; } In that redirection TesterPage.aspx, I have a Iframe page (Page Name = Iframe_tester.aspx)..., In tht "TesterPage.aspx"...,Backend code i am getting the cookie value and passing the value to my iframe page using querystring..., Code: ------ TesterPage.aspx.cs if (Request.Cookies["coktext"] != null) { typepid = Request.Cookies["coktext"].Value; arrtypepid = typepid.Split('~'); if (arrtypepid[0].ToString().ToLower().Trim() == "hi") { partid = arrtypepid[1].ToString(); } else { partid = string.Empty; } } else { partid = string.Empty; } page front end: --------------- TesterPage.aspx Now my question is: -------------------- The iframe page not getting the partid value..., As per my code, i feel its correct..., Is there any mistake i have done? Is there any other way i can handle? Thanks & Regards, Member 3879881, please don't forget to vote on the post -- Modified Tuesday, March 23, 2010 5:03 AM

      P Offline
      P Offline
      PSK_
      wrote on last edited by
      #2

      Member 3879881 wrote:

      function test() { document.cookie="coktext=Hi~test"; window.location="testerpage.aspx"; }

      Try specifying the expiry date other wise the cookie will be cleared immediately.

      Regards, Prakash Kalakoti

      M 1 Reply Last reply
      0
      • P PSK_

        Member 3879881 wrote:

        function test() { document.cookie="coktext=Hi~test"; window.location="testerpage.aspx"; }

        Try specifying the expiry date other wise the cookie will be cleared immediately.

        Regards, Prakash Kalakoti

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

        Hi Prakash, thanks for ur reply, Plz check my script i also given the same format only..., and understand my question, i didnt ask u to set cookie, asking u ppls to get it on backend code..., Thanks & Regards, Member 3879881, please don't forget to vote on the post

        P 1 Reply Last reply
        0
        • M Member 3879881

          Hi Prakash, thanks for ur reply, Plz check my script i also given the same format only..., and understand my question, i didnt ask u to set cookie, asking u ppls to get it on backend code..., Thanks & Regards, Member 3879881, please don't forget to vote on the post

          P Offline
          P Offline
          PSK_
          wrote on last edited by
          #4

          document.cookie="coktext=Hi~test";

          You are setting the value to cookie as Hi~test and at server side

          typepid = Request.Cookies["coktext"].Value;
          arrtypepid = typepid.Split('~');
          if (**arrtypepid[0].**ToString().ToLower().Trim() == "markets")

          you are expectiong the first part of the value to be "markets", but actually its "Hi". Can you check you logic again?

          Regards, Prakash Kalakoti

          M 1 Reply Last reply
          0
          • P PSK_

            document.cookie="coktext=Hi~test";

            You are setting the value to cookie as Hi~test and at server side

            typepid = Request.Cookies["coktext"].Value;
            arrtypepid = typepid.Split('~');
            if (**arrtypepid[0].**ToString().ToLower().Trim() == "markets")

            you are expectiong the first part of the value to be "markets", but actually its "Hi". Can you check you logic again?

            Regards, Prakash Kalakoti

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

            sorry actually i mistyped as markets..., Its if (arrtypepid[0].ToString().ToLower().Trim() == "hi") only,then also i didnt get o/p 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