I need include a lot of ASP.NET condition into my JS, for example
<% if (Boolean.Parse(System.Configuration.ConfigurationManager.AppSettings["DebugOutput"])) %>
<% { %>
else if (window.location.href.includes("Test1.aspx")) {
checkpanelsize();
if (Cookies.get('lm') == '1') {
$("#lftest").addClass("current");
}
else if (Cookies.get('lm') == '0') {
$("#lstest").addClass("current");
}
}
<% } %>
In other case I need export some function from this JS module, so I need place this JS module to separate JS file in order to export some function from this JS module with ASP.NET condition.
I expected that If I rename JS to .ASPX and include my module in the same way
<script type="text/javascript" src="Controls/LeftMenuJS.aspx"></script>
than ASP.NET condition in JS module will be working. But unfortunately no. Browser said me "Loading failed for the with source “http://localhost:9020/Controls/LeftMenuJS.aspx”."
JS file (wrapped in ASPX extension) is present in project directory, I can click to browser message and see my JS script packed to ASPX, but ASP.NET tags don't working.
How is possible to solve this problem? In this project I use ASP.NET Classic with NET Framework.