0

Okay, this might sound like a stupid question, but where exactly do I add the line <script src="Scripts/jquery-1.7.1.min.js" type="text/javascript"></script> in a .aspx page? I am newbie to both ASP.NET and jQuery. I am given a half complete ASP.NET project and I need to use jQuery to configure the UI. Everywhere I searched, it says first insert the above line inside the <head> tag. But my Default.aspx page does not have a <head> tag. Instead it has <asp:Content> and <asp:UpdatePanel> tags.

2
  • if you have a master page then include it there. place a head tag in the master page and place jquery inside head. Commented Jan 14, 2016 at 5:12
  • 1
    Before uploading any question, try to google it. If you would search it, you would find millions of result there. Commented Jan 14, 2016 at 5:35

2 Answers 2

2

Find you master page, normally it is called Site.master, and it's located in the root of the solution

For example

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form runat="server">

        <div class="main">
            <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
        </div>
    </form>
</body>
</html>
Sign up to request clarification or add additional context in comments.

Comments

1

Masterpage in webform is the place where you include all common css, javascripts. this can be found in another question on stackoverflow here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.