我想在頭動態鏈接javascript文件動態地在asp.net
<script src='<%=Global.RootPath%>js/jquery1.4.2.js' type="text/javascript"></script>
<script src='<%=Global.RootPath%>js/jquery.mousewheel-3.0.4.pack.js' type="text/javascript"></script>
鏈接到一個javascript文件,但我得到了一個錯誤
Controls集合不能修改,因爲該控件包含代碼塊(即<%...%>)。
描述:在執行 當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。
異常詳細信息:
System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
我要動態添加JavaScript文件。請解釋爲什麼我得到這個錯誤,是否有其他方法來做到這一點?