ObjectDataSource::UpdateParameters Property
Gets the parameters collection that contains the parameters that are used by the method that is specified by the UpdateMethod property.
Assembly: System.Web (in System.Web.dll)
[PersistenceModeAttribute(PersistenceMode::InnerProperty)] public: property ParameterCollection^ UpdateParameters { ParameterCollection^ get (); }
Property Value
Type: System.Web.UI.WebControls::ParameterCollectionA ParameterCollection that contains the parameters used by the method that is specified by the UpdateMethod property.
The names and types of the parameters that are contained in the UpdateParameters collection must match the names and types of the parameters in the UpdateMethod method signature. The parameter names are affected by the OldValuesParameterFormatString property and are case-sensitive. The parameters in the collection depend on the data in the data-bound control, the parameters that are specified declaratively, and the parameters that are added programmatically. For more information, see the "Parameter Merging" section in Update and Using Parameters with the ObjectDataSource Control.
The UpdateParameters property retrieves the UpdateParameters property that is contained by the ObjectDataSourceView object that is associated with the ObjectDataSource control.
For more information about parameter merging, object lifetime, and method resolution, see UpdateMethod.
Security Note: |
|---|
You should validate any parameter value that you receive from the client. The runtime simply substitutes the parameter value into the UpdateMethod property. |
This section contains two code examples. The first code example demonstrates how to use a DropDownList control, TextBox controls, and several ObjectDataSource objects to update data. The second code example shows the EmployeeLogic class that is used in the first code example.
The following code example demonstrates how to use a DropDownList control, TextBox controls, and several ObjectDataSource controls to update data. The DropDownList displays the name of a Northwind employee, while the TextBox controls are used to enter and update address information. Because the UpdateParameters collection contains a ControlParameter that is bound to the selected value of the DropDownList, the button that raises the Update operation is enabled only after an employee is selected.
Security Note: |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
The following code example shows the EmployeeLogic class that is used in the preceding code example.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note: