Recently made a Web site with a JS+CSS implementation of a two-level menu navigation bar, after the master page was created, the child page calls a lot of strange problems, the final solution after the multi-verification and everyone to share the next ....
1. Path issues
If this file path is called by a separate ASPX page, it will be
1 <link type="text/css" rel="stylesheet" href= " Navigator/css/shou.css " />2 <script type="text/javascript" src= " Navigator/js/dropdown.js "
Pages that reference the master page this makes an error, cannot find the JS or CSS file, or prompts an object, the function is undefined
Make sure that the master Page
<asp:content id= "Content1" contentplaceholderid= "Head" runat= "Server"/> Add an external CSS style or JS file on the sub-page
1<link type="Text/css"Rel="stylesheet"href="<%=page.resolveclienturl ("~/navigator/css/shou.css")%>"/>2<script type="Text/javascript"Src="<%=page.resolveclienturl ("~/navigator/js/dropdown.js")%>"></script>
This will resolve the JS, CSS file that cannot find the external reference
Asp. NET master page references external JS or CSS file invalid, prompt object undefined workaround