VB.Net load JS file if file exists
I'm trying to do this on a DotNetN开发者_StackOverflowuke site with multiple portals, so I want to do this server-side VB loads a javascript file if it exists. Any ideas?
<% 'If the portal.js exists, insert %>
<% if System.IO.File.Exists(Server.MapPath(PortalSettings.HomeDirectory & "portal.js")) then %>
<script src="<%= PortalSettings.HomeDirectory %>portal.js"></script>
<% end if %>
精彩评论