9 June, 2009
0 Comments
0 categories
You can’t add javascript script files to you’re page header by using the normal <link> and <script> tags, when you are using masterpages in ASP .NET.
You will have to do this in the code behind files or use one of the following methods:
Method 1 ASP .NET 1.1
<script src='<%= this.ResolveUrl("~/scripts.js") %>' type='text/javascript'></script>
Method 2 Using the ajax script manager
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" > <Scripts> <asp:ScriptReference Path="~/Script/Master.js" /> </Scripts> </asp:ScriptManager>
I used the second method.
Solution found at: http://forums.asp.net/t/987646.aspx
Tags: ASP .NET