c# - Path of home directory in asp.net -


I am using the Urlrewrite iis module, my virtual path: local host / news / example-content HTML

& lt; Script src = "js / jquery.min.js" & gt; & Lt; / Script & gt; = & gt; Localhost / News / JS / JqueryMM.JS

& lt; Script src = "../ js / jquery.min.js" & gt; & Lt; / Script & gt; = & gt; localhost / news /... js / jquery.mmjs

How can I fix this?

You can use the Server.MapPath method:

  & lt; Script src = '& lt;% = server mappath ("/ ~ js / jquery.min.js")%> Type = "text / javascript" & gt; & Lt; / Script & gt;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

c++ - Qt::make_shared for creating QSharedPtr as std::make_shared for creating std::shared_ptr -