Preferred way to include relative reference to JavaScript in VS 2008 nested Masterpage

前端 未结 3 1499
猫巷女王i
猫巷女王i 2021-01-02 14:55

Our base Masterpage has something like the following

  
   

   

        
3条回答
  •  爱一瞬间的悲伤
    2021-01-02 15:39

    As per ScottGu,

    One tip to take advantage of is the relative path fix-up support provided by the head runat="server" control. You can use this within Master Pages to easily reference a .CSS stylesheet that is re-used across the entire project (regardless of whether the project is root referenced or a sub-application):

    The path fix-up feature of the head control will then take the relative .CSS stylesheet path and correctly output the absolute path to the stylesheet at runtime regardless of whether it is a root referenced web-site or part of a sub-application.

提交回复
热议问题