0

I am building a mobile site and the footer has an background.

I want to check if the browser supports css property, background-image, if true display background with specific html, else display a different set of html.

I am using the following :

HttpBrowserCapabilities bc = new HttpBrowserCapabilities();

I can't seem to get a check for backgrounds.

The reason why I want to check for BG-image support is coz I have to switch between 2 sets of html. 1 with html text and bg image, and the other with the text on the image - sliced for each word/link...to give the same effect.

Marc Uberstein
  • 12,501
  • 3
  • 44
  • 72

2 Answers2

1

to get information by HttpBrowserCapabilities, you have to use Request.Browser property.

HttpBrowserCapabilities browerCapabilities = Request.Browser;
mRizvandi
  • 983
  • 1
  • 8
  • 20
0

I think Asp.net will automatically check the type of the browser and render the page accordingly. So if the the browser don't support background images it will not come.

Another idea to solve the issue is getting the browser type by using code, then you can show or hide the background images based on the type.

Wael Dalloul
  • 22,172
  • 11
  • 48
  • 57
  • The reason why I want to check for BG-image support is coz I have to switch between 2 sets of html. 1 with html text and bg image, and the other with the text on the image - sliced for each word/link. – Marc Uberstein Dec 13 '11 at 10:53
  • So you can get the browser type and then show what you want, there will be not too much browsers for your supported devices... – Wael Dalloul Dec 13 '11 at 11:00