URLRewriting时不会加载图片和Javascript [英] Image and Javascript are not loading when URLRewriting
问题描述
Hello All,
我的所有CSS和Java脚本链接都在Master Page中,并使用Application_BeginRequest重写Url。
网址:
localhost:49296 / SiteName / 12 / ProductName
to
localhost:49296 / SiteName / Post.aspx?id = 12
在Post.aspx中图像和JS不可用!
CSS工作正常 -
< link href =〜/ css / style.css =stylesheettype =text / css/>
但是JQuary已经不见了:
< script type =text / javascriptsrc =script / jquery.leanModal.min.js>< / script> < br $>
请帮助
尝试:
< script type = text / javascript src = <% = Page.ResolveUrl( 〜/ script / jquery.leanModal.min.js )%> > < / script >
Hello All,
I have My all CSS and Java scripts links are in Master Page, and rewriting Url Using Application_BeginRequest.
URL:
localhost:49296/SiteName/12/ProductName
to
localhost:49296/SiteName/Post.aspx?id=12
In Post.aspx Images and JS are not available !
CSS is working properly-
<link href="~/css/style.css" rel="stylesheet" type="text/css" />
but JQuary is gone :
<script type="text/javascript" src="script/jquery.leanModal.min.js"></script>
Please help
Try:
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/jquery.leanModal.min.js") %>"></script>
这篇关于URLRewriting时不会加载图片和Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!