Kumar AU

Kumar AU

  • NA
  • 98
  • 11.1k

How to Load the .css file for Chrome Browser and other Brows

Apr 9 2017 11:39 AM
I have two .css file one of Chrome brwoser and another one for all other brwoser, But why my java script is not getting called, I mean, I am unable to invoke the .css file in MVC view page, Please help me, Kindly find my below code which I am invoking through a.cshtml file
this is MVC 4.Net Project 
<script type="text/javascript" language="javascript" >
var printCSSfile = "quickui.print.css";
if (navigator.userAgent.toLowerCase().indexOf("chrome") > -1) {
printCSSfile = "quickui.printChrome.css";
}
document.write('<link href="~/Content/' + printCSSfile + '" rel="stylesheet" type="text/css" />');
</script>

Answers (5)