Click here to Skip to main content
16,020,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi

I currently need to detect which browser the user is using and i need to call either html 5 code or asp.net code.

The reason for this is that the users that are using my system have IE8 which does not support HTML 5 but some users have access to chrome and Firefox.

I need to add a video to the page to play, i have created an asp.net web control which will load the windows media player and play the video, issue with that is that windows media player is not supported by Chrome and Firefox requires a plugin to be downloaded which the client does not want to download any components for the browsers.

So i have included an html 5 video for chrome and firefox but i would like to know how could i call the asp.net code if the browser is found to be IE and if not call the HTML5?

Thanks

What I have tried:

I have tried getting the browser in user through javascript but i am not sure how to write the if else statement in javascript i am also not sure on how to call the asp.net code from Javascript.

I have thought of putting the code into 2 seperate divs and just hiding the div depending on the browser but i am not sure if this is the correct way to do it.
Posted
Updated 8-Feb-16 22:00pm
v2

1 solution

Have a look at Modernizr. It has a lot of methods to detect browser capabilities.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900