HttpRequest.Form Propiedad

Definición

Obtiene una colección de variables de formulario.Gets a collection of form variables.

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

Valor de propiedad

NameValueCollection que representa una colección de variables de formulario.A NameValueCollection representing a collection of form variables.

Ejemplos

En el ejemplo siguiente se muestra cómo leer los valores de la colección de formularios publicada desde un explorador.The following example shows how to read the values in the form collection posted from a browser. Cada par de nombre y valor de la colección representa un control en el formulario y su valor.Each name/value pair in the collection represents a control in the form and its value.

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
   

Comentarios

La Form propiedad se rellena cuando el valor de Content-Type la solicitud HTTP es "application/x-www-form-urlencoded" o "multipart/form-data".The Form property is populated when the HTTP request Content-Type value is either "application/x-www-form-urlencoded" or "multipart/form-data".

Se aplica a

Consulte también: