Validation.Unvalidated Method (HttpRequest, String)

Returns a value from the specified form field, cookie, or query-string variable without checking it first for HTML markup and client script.

Namespace:  System.Web.Helpers
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Unvalidated ( _
    request As HttpRequest, _
    key As String _
) As String
'Usage
Dim request As HttpRequest 
Dim key As String 
Dim returnValue As String 

returnValue = request.Unvalidated(key)
public static string Unvalidated(
    this HttpRequest request,
    string key
)
[ExtensionAttribute]
public:
static String^ Unvalidated(
    HttpRequest^ request, 
    String^ key
)
static member Unvalidated : 
        request:HttpRequest * 
        key:string -> string
public static function Unvalidated(
    request : HttpRequest, 
    key : String
) : String

Parameters

  • key
    Type: System.String
    The name of the field to exclude from validation. key can refer to a form field, to a cookie, or to the query-string variable.

Return Value

Type: System.String
A string that contains unvalidated text from the specified field, cookie, or query-string value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpRequest. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.111) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.111).

Remarks

Security noteSecurity Note

If you exclude a field from request validation, you must check it yourself to be sure it does not include malicious markup or code.

See Also

Reference

Validation Class

Unvalidated Overload

System.Web.Helpers Namespace

Other Resources

"Potentially Dangerous" errors in ASP.NET Web Pages (Razor)