HttpCookie.Values Property

Gets a collection of key/value pairs that are contained within a single cookie object.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public:
property NameValueCollection^ Values {
	NameValueCollection^ get ();
}
/** @property */
public NameValueCollection get_Values ()

public function get Values () : NameValueCollection

Not applicable.

Property Value

A collection of cookie values.

The following code example creates a new cookie and adds several values to it. For an example of how to extract multiple values from one cookie, see HasKeys.

No code example is currently available or this language may not be supported.
HttpCookie myCookie = new HttpCookie("Cookie1");

myCookie.get_Values().set_Item("Val1", "1");
myCookie.get_Values().set_Item("Val2", "2");
myCookie.get_Values().set_Item("Val3", "3");
get_Response().get_Cookies().Add(myCookie);

var myCookie : HttpCookie = new HttpCookie("Cookie1")
myCookie.Values["Val1"] = "1"
myCookie.Values["Val2"] = "2"
myCookie.Values["Val3"] = "3"
Response.Cookies.Add(myCookie)
   

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: