Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: JQuery – $ is not defined #9713
    blankfrancis-musignac
    Participant

    When using jQuery in asp.net, if you are using a master page and you are loading the jquery source file there, make sure you have the header contentplaceholder after all the jquery script references.

    I had a problem where any pages that used that master page would return ‘$ is not defined’ simply because the incorrect order was making the client side code run before the jquery object was created. So make sure you have:

    <head runat="server">
        <script type="text/javascript" src="Scripts/jquery-VERSION#.js"></script>
        <asp:ContentPlaceHolder id="Header" runat="server"></asp:ContentPlaceHolder>
    </head>
    

    That way the code will run in order and you will be able to run jQuery code on the child pages.

Viewing 1 post (of 1 total)