Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 26th, 2004, 10:36 AM
Authorized User
 
Join Date: Feb 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not able to read a cookie in the next page.

Hi Friends..

I have the problem to read the cookie which is like this :

1. I am passing value for some string to next page through it is using that value on that page.. that is woking. now problem . .I want to send the same value on the next page .. but not using that value on that page. but when I am updating data and coming back on original page it shoud read that cookie .. So I can get back that data from data base which i was extracting on the first original page with the updated value.
anybody's help most welcome..
in advance thanks.
aashish


Aashish Shah
__________________
Aashish Shah
 
Old February 26th, 2004, 10:43 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

So what exactly is the question? Are you unclear of how to use cookies? Where you should create the cookie? Where to read the cookie?
 
Old February 26th, 2004, 10:57 AM
Authorized User
 
Join Date: Feb 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

should i have to post the code tooo ...
Matter is that ....


I am passing the school number from page1 as a cookie. and I will get all the detail of the students on page2. No the second page there is the data fields which have the detail have every student id have to hyper link which takes user to next update page where I am passing the student id as a cookie. Now as soon as i submit the updated field I am just redirecting the page original page menas page 2. where the whole details of the students are there.. but I am not getting the data b'cos I am not able to get the cookie value of the school number . so what I want to do .. if I can store that cookie value of school number on the update page and when I press the submit button it should pass the value of school number back on the page so I can get the data with update for the same school which I was showing before ..
Now should i have to post the code on the site too.. or you can help me with this discription.. I am new for the cookie collection thats why..
thanks
thanks


Aashish Shah
 
Old February 26th, 2004, 11:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can use Session State.

Session("myItem") = "Hello"

Response.write(Session("myItem"))
 
Old February 26th, 2004, 01:09 PM
Authorized User
 
Join Date: Feb 2004
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks I get the problem .. it is working now..
thanks a lot ..


Aashish Shah
 
Old February 26th, 2004, 01:13 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm having a hard time understanding your question and scenario, but perhaps this will give you enough information to go on.

It sounds as though you need to carry a value around between pages. As stu9820 suggested, the use of the session collection is ideal for this. On any page where you need to SAVE the value so that other pages can use it, you just need to assign the value to a session collection key:

Session("myItem") = "Hello"

Then on any page that needs to USE that value, you just retrieve the value from the session collection by the same key name you saved it with:

myLocalPageVariable = Session("myItem")

Then you can use that for whatever you like. You will need to cast the value from the session to the appropriate type in order to use it properly because the session collection returns an Object.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read child page form value on different domain davenic Javascript How-To 9 December 2nd, 2007 09:38 PM
Read the mail address from the web page gmbalaa General .NET 0 September 14th, 2007 04:12 AM
Session/Cookie Expires, Login page appears rajn ASP.NET 1.0 and 1.1 Professional 3 June 27th, 2007 06:19 AM
login page. cookie handling. richie86 ASP.NET 1.0 and 1.1 Basics 1 November 27th, 2005 05:13 AM
Cookie Error when run web page test.aspx C#.net minhpx General .NET 1 August 10th, 2004 01:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.