1. image problems
Excellent solution
With runat = "server" added, the PATH uses the absolute path ~ /It is basically OK.
2. CSS file reference
<LINK rel = "stylesheet" type = "text/CSS" href = "style.css"/>
The magic here is that the href of The Link file is automatically adjusted with the directory structure of the accessed file. To put it bluntly, you can consider the path referenced by the master page.
For example, if the master page referenced by XXX. aspx in a folder under the same directory on the master page, the preceding statement automatically becomes
<LINK rel = "stylesheet" type = "text/CSS" href = "../style.css"/>
The premise is that
3. js file reference
<SCRIPT type = "text/JavaScript" src = "menu/jquery. Min. js"> </SCRIPT>
In this case, the client will not be able to reference the page files in other directories.
So you need to handle it like this
<SCRIPT type = "text/JavaScript" src = '<% = resolveurl ("menu/jquery. Min. js") %>'> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = '<% = resolveclienturl ("menu/ddsmoothmenu. js") %>'> </SCRIPT>
There are two methods, and the path on the client will be different, respectively:
<SCRIPT type = "text/JavaScript" src = '/tlerp/menu/jquery. Min. js'> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = '../menu/ddsmoothmenu. js'> </SCRIPT>
Obviously, resolveclienturl is a relative path, which is relatively easy to use. Of course, resolveurl also requires such an absolute path in many places, where tlerp is the name of a Web application.
In addition, if youCodeIn
Control contains code blocks (that is, <%... %>), so the control set cannot be modified.
The reason is that you can put the referenced content in <body>, even between <body> and <form>.