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.
-
if you have a master page then include it there. place a head tag in the master page and place jquery inside head.Umer Hayyat– Umer Hayyat2016-01-14 05:12:29 +00:00Commented Jan 14, 2016 at 5:12
-
1Before uploading any question, try to google it. If you would search it, you would find millions of result there.Khazratbek– Khazratbek2016-01-14 05:35:31 +00:00Commented Jan 14, 2016 at 5:35
Add a comment
|
2 Answers
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>
Comments
Masterpage in webform is the place where you include all common css, javascripts. this can be found in another question on stackoverflow here