asp.net.ph

FormParameter Class

System.Web.UI.WebControls Namespace


.NET Framework version 2.0

Binds the value of an HTTP request Form field to a parameter object.

FormParameter Class Members

Collapse   Constructors

Visibility Constructor Parameters
public FormParameter ( )
public FormParameter ( String name , String formField )
public FormParameter ( String name , DbType dbType , String formField )
public FormParameter ( String name , TypeCode type , String formField )

Collapse   Properties

Visibility Name Value Type Accessibility
public FormField String [ Get , Set ]
public ValidateInput Boolean [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
protected Clone ( ) Parameter

Remarks

You can use the FormParameter class to bind the value of a form variable in the Form collection to a parameter used in a parameterized query or command. Controls that bind data to the parameter might throw an exception if a FormParameter is specified but no corresponding form variable is passed. They might also display no data if the form variable is passed with no corresponding value. Set the DefaultValue to avoid these situations where appropriate.

The FormParameter class provides the FormField property, which identifies the name of the form variable to bind to, in addition to those inherited from the Parameter class.

IMPORTANT: The FormParameter does not validate the value passed by the form element in any way; it uses the raw value. In most cases you can validate the value of the FormParameter before it is used by a data source control by handling an event, such as the Selecting, Updating, Inserting, or Deleting event exposed by the data source control you are using. If the value of the parameter does not pass your validation tests, you can cancel the data operation by setting the Cancel property of the associated CancelEventArgs class to true.

See Also

Using Parameters with Data Source Controls Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph