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