Reputation: 17614
Is there any difference in using the following
Request.Cookies["Key"].Value
and
Request.Cookies["Key"].ToString()
Upvotes: 0
Views: 518
Reputation: 3012
Yes, running the following block of code demonstrates the different outputs:
Request.Cookies.Add(new HttpCookie("Test", "MyValue"));
Debug.Print(Request.Cookies["Test"].Value);
Debug.Print(Request.Cookies["Test"].ToString());
The first debug print will display "MyValue" whereas the second will display "System.Web.HttpCookie".
Upvotes: 1