How to Load Style Sheets based on the Browser type(ex: Internet Explorer, Firefox,....) in ASP.NET by using JavaScript The best approach is to use the JavaScript at the client side to make web browser request different style sheet file. If the JavaScript is disabled in the user's browser, we include the default style sheet file using the
Now, using that method all we need is to put that code in each web page, or you can put the JavaScript part in the separate file and include it using the html tag Note that in that case you still need the Advantages: This method appears to be quite bulletproof. It works fine even if web cache server supplies same page to all the browsers because browser will request different stylesheet. One could say that this method makes the user's browser do the job for your the web server. Disadvantages: The only problem we encountered is when user saves your web page locally and then opens it in another browser not naving an internet access. In this case browser won't be able to open needed stylesheet file and will render your web page using default settings. You can see how this method works here jscssmethod.html (html source at jscssmethod.html.txt). |
--
Regards:
M.Rama Subba Reddy
Cell:+919080391242
Love to read it really good information thank you for sharing us..,
ReplyDeleteBest Freshers Software Jobs