Share via


ResponseExtensions.SetStatus Method (HttpResponseBase, Int32)

Sets the HTTP status code of an HTTP response using the specified integer value.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Sub SetStatus ( _
    response As HttpResponseBase, _
    httpStatusCode As Integer _
)
'Usage
Dim response As HttpResponseBase 
Dim httpStatusCode As Integer 

response.SetStatus(httpStatusCode)
public static void SetStatus(
    this HttpResponseBase response,
    int httpStatusCode
)
[ExtensionAttribute]
public:
static void SetStatus(
    HttpResponseBase^ response, 
    int httpStatusCode
)
static member SetStatus : 
        response:HttpResponseBase * 
        httpStatusCode:int -> unit
public static function SetStatus(
    response : HttpResponseBase, 
    httpStatusCode : int
)

Parameters

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpResponseBase. 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).

See Also

Reference

ResponseExtensions Class

SetStatus Overload

System.Web.WebPages Namespace