Share via


IAppHostPropertySchema::ValidationParameter Property

 

Provides attribute-validation parameter information for the current property.

Syntax

HRESULT get_ValidationParameter(  
   [out,  
   retval,  
   string] BSTR* pbstrValidationParameter  
);  

Parameters

pbstrValidationParameter
A pointer to a BSTR that contains the validation parameter.

Return Value

An HRESULT. Possible values include, but are not limited to, those in the following table.

Value Description
S_OK Indicates that the operation was successful.

Remarks

Attribute validation is performed when XML is parsed and when the API makes a call to set a value in the configuration system.

The following table provides the available validation types.

Validation type Description
applicationPoolName Will fail validation if the property value contains any one of the following characters: &#124;<>&\"

The following example will cause validation failure if the property value includes one of the restricted characters.

 validationType="applicationPoolName"

 validationParameter=""
integerRange Syntax: <minimum>,<maximum>[,exclude]

Will fail validation if the property value is set to a value outside the specified range.

The following example will cause validation failure if the property is set to a value less than 1 or larger than 10.

 validationType="integerRange"

 validationParameter="1,10,exclude"
nonEmptyString Will fail validation if the property value is set to an empty string.

The following example will cause validation failure if the property value is set to an empty string.

 validationType="nonEmptyString"

 validationParameter=""
siteName Will fail validation if the property value contains any one of the following characters: /\.?

The following example will cause validation failure if the property value includes one of the restricted characters.

 validationType="siteName"

 validationParameter=""
timeSpanRange Syntax: <minimum>,<maximum>,<granularity>[,exclude]

Will fail validation if the property value is set to a value outside the specified range. <granularity> indicates the increments that are allowed between <minimum> and <maximum>.

The following example will cause validation failure if the property is set to a value less than 1, greater than 2592000, and is not an increment of 60 within the range.

 validationType="timeSpanRange"

 validationParameter="1,2592000,60"
requireTrimmedString Will fail validation if white space is found at the start or end the property value.

The following example will cause validation failure if the property value contains white space at the start or end of the value.

 validationType="requireTrimmedString"

 validationParameter=""

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016 Technical Preview
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- IIS Express 7.5, IIS Express 8.0, IIS Express 10.0
Header Ahadmin.h

See Also

IAppHostPropertySchema Interface
IAppHostPropertySchema::ValidationType Property