Now this is annoying me, I’m trying to take an existing classic ASP solution and convert it to ASP.Net 2.0 as a learning exercise. The problem is that I’m struggling to convert this –
<head>
<title>A Page</title>
<% if intCategoryID < 3 then %>
<script language="javaScript"
src="http://www.foo.com/foo.js"></script>
<% end if %>
</head>
So, I want to only include the JavaScript if a condition is met (in this case intCategoryID < 3). How do I achieve this in ASP.Net?? I have looked at an asp:literal tag to achieve this but Visual Web Developer suggests a literal cannot include child tags (the script tag itself). Can I add one programmatically from the codebehind?
I hope I can find a solution to this..