0 Comments

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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts