How to ADD javascript files and css to a contentpage of a master page in asp.net -
how can add javascript files , css contentpage of master page in asp.net. tried include datetime picker contentpage. bur works on masterpage . when try put same in contentpage doesn't work.
this content page code: <%@ page title="" language="c#" masterpagefile="~/testmasterpage.master" autoeventwireup="true" codefile="datetime.aspx.cs" inherits="datetime" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> <link href="css/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="js/jquery-ui-1.8.19.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $("#txtdate").datepicker(); }); </script> <style type="text/css"> .ui-datepicker { font-size:8pt !important} </style> </asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <asp:textbox id="txtdate" runat="server"></asp:textbox> </asp:content> masterpage code: <head runat="server"> <title></title> <asp:contentplaceholder id="head" runat="server"> </asp:contentplaceholder> </head> <body> <asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder> `</body>` </html>
the <script></script>
, <style></style>
tags should go <head></head>
tag.
Comments
Post a Comment