473,395 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ASP.NET not writing cookies, not using codebehind file

Hi,

I figured this one out before and have forgotten the answer. I have an
..aspx page that has user settable options. When you click an option in
the listbox for example, it should save that option as a cookie as long
as your browser is open..The minute you leave the page and come back
(same site), it forgets. I am writing the cookie in the
page_load...Here's my code....Also, i'm not using codebehind and am not
compiling. (This is a one-off .NET page integrated within a legacy ASP
site.) Am I missing something in my GLobal.asax? my web.config? Help
please?! I have it working in a compiled version of a different ASP.NET
site and can't see where I've gone wrong.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

If isPostBack Then

pil_category = lbPILCategory.SelectedItem.Value
Response.Cookies("session")("pilcategory")= pil_category

Response.write("cookie="&pil_category) 'this writes the correct
answer
else

pil_category = Request.Cookies("session")("pilcategory")
Response.write("pilcategory="&pil_category)
if pil_category <> NOTHING then
lbPILCategory.SelectedValue = pil_category
end if

end if

end sub

Nov 19 '05 #1
0 991

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Google Mike | last post by:
Tell me if this can be done, and if I have a misconception here. I am writing an app that will be served up in an app farm, and therefore I need to move the session information to the client, not...
20
by: Brian Burgess | last post by:
Hi all, Anyone know if this is possible? If so, on which page would the cookie be? .. On the page calling a function defined in the include file? thanks in advance.. -BB
7
by: Brian Burgess | last post by:
Hi all, Anyone see anything wrong with the following: *************************************************************** <%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit Dim nAcctNbr Dim...
3
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
1
by: Andrew Parsons | last post by:
Hi all, I had a weird issue with trying to use a cookie in a ASCX housed on my web forms and I was wondering if I am missing something. I wanted to use the authenticated cookie for the user...
4
by: lalitha1024 | last post by:
Hi, In my Asp.net project when i am login to my site, i'll set th cookies by using below commands. Dim IdCookie As New HttpCookie("empid" ds.Tables(0).Rows(0).Item(0)) Dim FnameCookie As New...
1
by: SamG | last post by:
Hello, Does anyone know how I can Write a Cookie and then later retrieve it...? Also, Is it possible to write attributes and corresponding values to the cookie file.Needless to say would require...
0
by: stillworkingfortheman | last post by:
I'm loosing cookies in IE6 (works okay with firefox) with the following steps... step 1. set a cookie in one domain, in an .aspx.cs codebehind... in www.domain.com/subdomain1/page1.aspx...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.