ContainerBrowser Property (.NET)

Type: String

 

ContainerBrowser returns the name of the actual browser in which an embedded IE engine is contained within. When Netscape is used in IE emulation mode, this property returns "Netscape". For the AOL Explorer browser, it returns "AOL Explorer". For content viewed via Windows Media Player, it returns "Windows Media Player". For browsers not running IE emulation this property will be equal to an empty string.

 

Tip: See Detecting Browsers That Emulate Internet Explorer for important additional information on browsers that embed IE.

 

Example 1:

This example demonstrates how to determine if a browser is really IE or if it is a non-IE browser running with IE emulation through an embedded IE engine. The results of the test are then displayed:

 

<html>

<%

BrowserObj browObj = BrowserObj.GetBrowser();

if (browObj.Browser == "IE" && browObj.ContainerBrowser != "") {

// This is a browser emulating IE

Response.Write("Your are running a browser that is emulating IE version " + browObj.Fullversion + "<br>");

Response.Write("Your browser really is " + browObj.ContainerBrowser + " " + browObj.ContainerFullversion);

} else {

Response.Write("Your browser is " + browObj.Browser + " version " + browObj.Fullversion);

}

%>

</html>

 

Example 2:

This example demonstrates how to determine if a browser is really IE or if it is a non-IE browser running with IE emulation through an embedded IE engine. If the browser is using IE emulation the visitor is redirected to an alternative page.

<% BrowserObj browObj = BrowserObj.GetBrowser();

if (browObj.Browser == "IE" && browObj.ContainerBrowser != "") {

// This is a browser emulating IE

Response.Redirect("http://www.yahoo.com"); // obviously you would redir to a page on your site

}

%>

<html> Page for real IE and any browsers not emulating IE goes here </html>

 

See Also:

Detecting Browsers That Emulate Internet Explorer

ContainerVersion Property (.NET)

ContainerFullversion Property (.NET)