给出一棵树 -
C:\mydirINET\\Central35webapp
example_A.aspx
example_B.aspx
---->\App_Themes
-------->\Styles
------------SABT_template.css
There is code in Page_Load that resolves--
// get the root directory
string rootDir = page.ResolveUrl("~");
Here are two html fragments.
Are these two examples equivalent?
Why would one be used rather than another?
Are either of these customary in a particular ASP.NET version?
example_A
<link href="<%=rootDir%>/Styles/SABT_template.css" rel="stylesheet" type="text/css">
example_B
<link href="/App_Themes/Styles/SABT_template.css" rel="stylesheet" type="text/css" />
tkx,donPablo
答案 0 :(得分:0)
page.ResolveUrl
说明可能未在主机上生根的IIS应用程序。
如果您的应用程序位于app
目录中,则/app_themes...
将不正确。