Today, I want to add a jqueryui control on the input tab of the content page to create a date selector by clicking the text box, however, no matter whether I put the JS Code in the template masterpage or in the contentplaceholder of the content page, the JS Code does not run normally and does not see the jquery effect. After repeated research, I come to the conclusion that, javaScript code must be placed in head contentplaceholder on the Content Page. For example, the Code is as follows:
<Asp: Content ID = "content1" contentplaceholderid = "head" runat = "server">
<Link href = "CSS/smoothness/jquery-ui-1.8.14.custom.css" rel = "stylesheet" type = "text/CSS"/>
<SCRIPT src = "JS/jquery-1.6.1.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT src = "JS/jquery-ui-1.8.14.custom.min.js" type = "text/JavaScript"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
$ (Function (){
$ ("# <% = Txtbrithday. clientid %>"). datepicker ({
Changemonth: True,
Changeyear: True
});
$ ("# <% = Txtregdate. clientid %>"). datepicker ({
Showon: "button ",
Buttonimage: "images/calendar.gif ",
Buttonimageonly: True
});
});
</SCRIPT>
</ASP: content>