{"id":174,"date":"2015-04-21T16:24:02","date_gmt":"2015-04-21T16:24:02","guid":{"rendered":"http:\/\/www.edcortes.ph\/?p=643"},"modified":"2021-07-10T03:33:25","modified_gmt":"2021-07-10T03:33:25","slug":"stylesheet-not-working-on-pages-from-other-folders","status":"publish","type":"post","link":"https:\/\/emcortes.com\/?p=174","title":{"rendered":"Stylesheet not working on pages from other folders"},"content":{"rendered":"<p>I used a master on pages of my ASP.NET application. CSS and Script files were\u00a0used in the master using\u00a0a reference lines as:<\/p>\n<pre>&lt;link rel=\"stylesheet\" href=\"css\/style.css\" runat=\"server\" \/&gt;<\/pre>\n<pre>&lt;script src=\"js\/jquery.min.js\"&gt;&lt;\/script&gt;<\/pre>\n<p>It works on pages on same root where the CSS and Script folders are located but it never worked in another pages which are located in other folders. I resolved this issue by changing the references\u00a0as follows:<\/p>\n<pre>&lt;link rel=\"stylesheet\" href=\"~\/css\/style.css\" runat=\"server\" \/&gt;<\/pre>\n<pre>&lt;script src=\u2019&lt;%# ResolveUrl(\"~\/js\/jquery.min.js\")%&gt;\u2019 type=\"text\/javascript\"&gt;&lt;\/script&gt;<\/pre>\n<p>There\u2019s a line in script that I changed as well to ensure that the file is linked correctly.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I used a master on pages of my ASP.NET application. CSS and Script files were\u00a0used in the master using\u00a0a reference lines as: &lt;link rel=&#8221;stylesheet&#8221; href=&#8221;css\/style.css&#8221; runat=&#8221;server&#8221; \/&gt; &lt;script src=&#8221;js\/jquery.min.js&#8221;&gt;&lt;\/script&gt; It works on pages on same root where the CSS and Script folders are located but it never worked in another pages which are located in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,4],"tags":[],"class_list":["post-174","post","type-post","status-publish","format-standard","hentry","category-asp-net","category-programming-notes"],"_links":{"self":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=174"}],"version-history":[{"count":1,"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":235,"href":"https:\/\/emcortes.com\/index.php?rest_route=\/wp\/v2\/posts\/174\/revisions\/235"}],"wp:attachment":[{"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emcortes.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}