HttpRequest.Form Eigenschap

Definitie

Hiermee haalt u een verzameling formuliervariabelen op.

public:
 property System::Collections::Specialized::NameValueCollection ^ Form { System::Collections::Specialized::NameValueCollection ^ get(); };
public System.Collections.Specialized.NameValueCollection Form { get; }
member this.Form : System.Collections.Specialized.NameValueCollection
Public ReadOnly Property Form As NameValueCollection

Waarde van eigenschap

Een NameValueCollection weergave van een verzameling formuliervariabelen.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de waarden in de formulierverzameling leest die vanuit een browser zijn gepost. Elk naam/waardepaar in de verzameling vertegenwoordigt een besturingselement in het formulier en de bijbehorende waarde.

int loop1;
NameValueCollection coll;

//Load Form variables into NameValueCollection variable.
coll=Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
   Response.Write("Form: " + arr1[loop1] + "<br>");
}

Dim loop1 As Integer
Dim arr1() As String
Dim coll As NameValueCollection
 
' Load Form variables into NameValueCollection variable.
coll=Request.Form

' Get names of all forms into a string array.
arr1 = coll.AllKeys
For loop1 = 0 To arr1.GetUpperBound(0)
   Response.Write("Form: " & arr1(loop1) & "<br>")
Next loop1
   

Opmerkingen

De Form eigenschap wordt ingevuld wanneer de HTTP-aanvraagwaarde Content-Type 'application/x-www-form-urlencoded' of 'multipart/form-data' is.

Van toepassing op

Zie ook