//
you're reading...
asp.net

Iterate Browser Capabilities

In order to obtain a list of browser capabilities use the Request.Browser.Capabilities collection of DictionaryEntry(s). While it is extremely obvious once located it was not immediately obvious as you cannot iterate over the Browser object, itself.

protected void Page_Load(object sender, EventArgs e)
{
HttpBrowserCapabilities bc = Request.Browser;
SortedList bcList = new SortedList();</code>

foreach (System.Collections.DictionaryEntry p in bc.Capabilities)
{
bcList.Add(p.Key.ToString(), (p.Value == null ? "" : p.Value.ToString()));
}

BrowserProperties_GridView.DataSource = bcList;
BrowserProperties_GridView.DataBind();
}

Advertisement

About art colman

XML tools and consulting for standards development.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.