IAppHostPropertySchema::ValidationType Property

 

Describes the type of validation that will be performed for the current property.

Syntax

HRESULT get_ValidationType(  
   [out,  
   retval,  
   string] BSTR* pbstrValidationType  
);  

Parameters

pbstrValidationType
A pointer to a BSTR that indicates the validation type. Valid values are "applicationPath", "applicationPoolName", "integerRange", "nonEmptyString", "siteName", "timeSpanRange", "requireTrimmedString" and "virtualDirectoryPath".

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. A <granularity> value of 60 indicates that the time span represents seconds, and a value of 1 indicates that the time span represents minutes.

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

 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::ValidationParameter Property