开发者

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 %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜