Export (0) Print
Expand All

Parameter.DefaultValue Property

Specifies a default value for the parameter, should the value that the parameter is bound to be uninitialized when the Evaluate method is called.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

member DefaultValue : string with get, set

Property Value

Type: System.String
A string that serves as a default value for the Parameter when the value it is bound to cannot be resolved or is uninitialized.

The DefaultValue property is used in scenarios where the parameter is bound to a value, but the value is a null reference (Nothing in Visual Basic) or cannot be resolved when the Parameter object is evaluated.

If the DefaultValue property of the parameter is changed, the OnParameterChanged method is called.

The following code example demonstrates how to retrieve a single data record using an ObjectDataSource control and display it in a DetailsView control. The ObjectDataSource control retrieves a specific employee record by calling the GetEmployee method of the EmployeeLogic class. The GetEmployee method requires an employee ID parameter. The ObjectDataSource control uses a QueryStringParameter object in its SelectParameters collection to pass an ID to the GetEmployee method in this example.

To view the example implementation of the EmployeeLogic class and the GetEmployee method, see the ObjectDataSource class overview.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft