C
Clint
I am using the following C# code in a function called by a
button click:
HttpCookie cookie = new HttpCookie("UserName");
cookie.Value = tbUserName.Text;
Response.Cookies.Add(cookie);
When I go to look for this cookie on my system, I cannot
find it anywhere. If I close my browser, then open the
browser again and try to reload the page, I get ASP.NET
errors because of a null reference when the cookie was not
found. Obviously, I need to add some code to check if the
cookie exists and if not load the page with defaults, but
why is the cookie not created? Am I missing something? I
am testing this on a Windows XP Professional system
running IIS.
button click:
HttpCookie cookie = new HttpCookie("UserName");
cookie.Value = tbUserName.Text;
Response.Cookies.Add(cookie);
When I go to look for this cookie on my system, I cannot
find it anywhere. If I close my browser, then open the
browser again and try to reload the page, I get ASP.NET
errors because of a null reference when the cookie was not
found. Obviously, I need to add some code to check if the
cookie exists and if not load the page with defaults, but
why is the cookie not created? Am I missing something? I
am testing this on a Windows XP Professional system
running IIS.