Share via


BrowserHelpers.SetOverriddenBrowser Method (HttpContextBase, String)

Overrides the request's actual user agent value using the specified user agent.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Sub SetOverriddenBrowser ( _
    httpContext As HttpContextBase, _
    userAgent As String _
)
'Usage
Dim httpContext As HttpContextBase 
Dim userAgent As String 

httpContext.SetOverriddenBrowser(userAgent)
public static void SetOverriddenBrowser(
    this HttpContextBase httpContext,
    string userAgent
)
[ExtensionAttribute]
public:
static void SetOverriddenBrowser(
    HttpContextBase^ httpContext, 
    String^ userAgent
)
static member SetOverriddenBrowser : 
        httpContext:HttpContextBase * 
        userAgent:string -> unit
public static function SetOverriddenBrowser(
    httpContext : HttpContextBase, 
    userAgent : String
)

Parameters

Usage Note

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

BrowserHelpers Class

SetOverriddenBrowser Overload

System.Web.WebPages Namespace