Share via


HttpContextHelper.ExecuteInNullContext Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Sets the HTTP context to nulla null reference (Nothing in Visual Basic), executes the specified action delegate, and then restores the previous HTTP context.

Namespace:  Microsoft.Web.Infrastructure
Assembly:  Microsoft.Web.Infrastructure (in Microsoft.Web.Infrastructure.dll)

Syntax

'Declaration
Public Shared Sub ExecuteInNullContext ( _
    action As Action _
)
'Usage
Dim action As ActionHttpContextHelper.ExecuteInNullContext(action)
public static void ExecuteInNullContext(
    Action action
)
public:
static void ExecuteInNullContext(
    Action^ action
)
static member ExecuteInNullContext : 
        action:Action -> unit 
public static function ExecuteInNullContext(
    action : Action
)

Parameters

Remarks

This method allows partial trust code to execute without allowing the partial trust code to set the HTTP context to arbitrary values.

See Also

Reference

HttpContextHelper Class

Microsoft.Web.Infrastructure Namespace