Re: Master Page Best Practice

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Heaven,

Since client-side <script> tag can not be marked with "runat=server"(it
will make it be parsed as server-side code at compilation time), you can
consider embed some server code expression to render the dynamic resolved
path. For example:

==========================

<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="<%=
ResolveUrl("~/scripts/common.js") %>"></script>
...................
=========================

BTW, when using the above embeded code block in <head> section, it will
make the Page.Header.Controls collection no longer modifiable(add nor
remove subcontrols in it). Therefore, if you may consider move the script
block into other postion in page if this is the case.

Please feel free to let me know if you have any other concerns on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

.