Re: Problem with cookies

Tech-Archive recommends: Fix windows errors by optimizing your registry



I stopped trying it, I'm trying Profile system... But I have a big problem, since it works against SQL and I'm developping a 3 tier application, so I would like to use my BLL or a single XML file to store profiles, but I'm unable to find an implemention in XML...

I'm studying http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ASPNETProvMod_Prt5.asp but I can't find a more realistic example of xml driven ProfileProvider... Can you point me to a more practical site ?

Thanks

MSDN wrote:
Patxi,

Have you tired this without master page?
I am using IIS 5.1, Win XP Pro

SA

"Patxi" <patxi@xxxxxxxxx> wrote in message news:446364f6$0$281$626a54ce@xxxxxxxxxxxxxxx
For the record, I'm using an IIS virtual directory, running IIS 5.0...

MSDN wrote:
This is very strange I am having the same problem you are having using your example.
it seems that the cookie is saved for a specific page and not the entire website.
I suspected that may be it has to do with ASP.NET 2.0 and VS 2005 and the WebServer with PORT NUMBER etc...
So I moved the sample I have to a web site and the same thing is happening.
The cookie does not have to persist.
Still looking for an answer.

SA

"Patxi" <patxi@xxxxxxxxx> wrote in message news:4462c6f5$0$296$636a55ce@xxxxxxxxxxxxxxx
I have no chache settings...

MSDN wrote:
Patxi,

If you put a breakpoint in the OnPreRender event handler does it get called all the time
It is not called all the time. Is it due to caching??

SA

"Patxi" <patxi@xxxxxxxxx> wrote in message news:4462471c$0$300$626a54ce@xxxxxxxxxxxxxxx
This is the first time I try to use cookies, and despite of reading some tutotials, I'm have real trouble to make it work correctly. My cookie reading code is in Master Page. When I click on a test button (in a WEb User Control inside the aspx page), cookie value is displayed in Master Page but if I go to another page, no value is displayed...

I need to be able tu use cookie's value across all the site... What am I doing wrong ?

Code in WebUser control, this code on a button click event:

8<---------------------

HttpContext.Current.Response.Cookies["TestValue"].Value = mstrMyValue;
HttpContext.Current.Response.Cookies["TestValue"].Expires = DateTime.Today.AddDays(365);

--------------------->8

And this code in OnPreRender of my Master page:

8<---------------------

if (Request.Cookies["TestValue"] != null){
litCookieTest.Text = Response.Cookies["TestValue"].Value;
}else{
litCookieTest.Text = Request.Cookies["TestValue"].Value;
}
--------------------->8


.


Quantcast