Hari Krishnan
Hari Krishnan

Reputation: 301

IE conditional comments not working in aspx page

I want to use the IE conditional comments to load the Angular scripts based on the IE version. But the conditional comments are not working, it throws error as angular is undefined? can anyone help me with this? the IE conditional comments will not work inside <asp:content> tag?

<asp:Content ID="Content2" ContentPlaceHolderID="ScriptSection" runat="server">

    <!--[if lt IE 9]>
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular-1.2.16.min.js")%>' type="text/javascript"></script>
<![endif]-->

    <!--[if gte IE 9]>
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular.min.js")%>' type="text/javascript"></script>
<![endif]-->
</asp:Content>

Upvotes: 0

Views: 207

Answers (1)

Kaushik Maheta
Kaushik Maheta

Reputation: 1891

<![if IE]>   
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular-1.2.16.min.js")%>' type="text/javascript"></script>
<![endif]>

<![if IE]>   
<script src='<%= Page.ResolveClientUrl("~/Scripts/angular.min.js")%>' type="text/javascript"></script>
<![endif]>   

Upvotes: 1

Related Questions