AspNetCore.Docs/aspnet/whitepapers/aspnet4/overview/samples/sample33.cs

14 lines
375 B
C#

public class CustomProvider : HttpCapabilitiesEvaluator
{
public override HttpBrowserCapabilities
GetBrowserCapabilities(HttpRequest request)
{
HttpBrowserCapabilities browserCaps =
base.GetHttpBrowserCapabilities(request);
if (browserCaps.Browser == "Unknown")
{
browserCaps = MyBrowserCapabilitiesEvaulator(request);
}
return browserCaps;
}
}