DatePicker using JQuery
-
Hi, Im using datepicker using standalone jquery. The datepicker works perfectly in WebForm. Now i decided to use a site master on my sample project and I add some web content form also inside the site.master. In my web content form i add search function with date range. Now, the problem was, after using web content form, datepicker no longer showing the icon "..." beside my asp:textbox. Please see below tags in my site.Master page.
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/scripts/datepickerjs/jquery-1.3.1.min.js" />
<asp:ScriptReference Path="~/scripts/datepickerjs/jquery-ui-1.7.1.custom.min.js" />
<asp:ScriptReference Path="~/scripts/datepickerjs/daterangepicker.jQuery.js" />
</Scripts>
</asp:ScriptManager>i also place the css in site.master inside the head tag.
<link rel="Stylesheet" type="text/css" href="style/datepickercss/ui.daterangepicker.css" />
<link rel="Stylesheet" type="text/css" href="style/datepickercss/redmond/jquery-ui-1.7.1.custom.css" title="ui-theme" />In my web content form i place the script after the asp:Content tag.
<script type="text/jscript"> $(function() { $("#txtDateFrom").datepicker({ changeMonth: true, changeYear: true, buttonText: 'Select Date From', buttonImage: 'images/calendar.gif', buttonImageOnly: true, showOn: 'button' }); }); $(function() { $("#txtDateTo").datepicker({ changeMonth: true, changeYear: true, buttonText: 'Select Date To', buttonImage: 'images/calendar.gif', buttonImageOnly: true, showOn: 'button' }); }); </script>
Finally, when i run my project the "..." is not showing. Normally, when i used web form this "..." will show and i can select a date, but now after switching to web content form, "..." is no longer visible. Thanks
if(you type your code here) { Messagebox.Show("You help me a lot!"); } else { You help me = null; }
-
Hi, Im using datepicker using standalone jquery. The datepicker works perfectly in WebForm. Now i decided to use a site master on my sample project and I add some web content form also inside the site.master. In my web content form i add search function with date range. Now, the problem was, after using web content form, datepicker no longer showing the icon "..." beside my asp:textbox. Please see below tags in my site.Master page.
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/scripts/datepickerjs/jquery-1.3.1.min.js" />
<asp:ScriptReference Path="~/scripts/datepickerjs/jquery-ui-1.7.1.custom.min.js" />
<asp:ScriptReference Path="~/scripts/datepickerjs/daterangepicker.jQuery.js" />
</Scripts>
</asp:ScriptManager>i also place the css in site.master inside the head tag.
<link rel="Stylesheet" type="text/css" href="style/datepickercss/ui.daterangepicker.css" />
<link rel="Stylesheet" type="text/css" href="style/datepickercss/redmond/jquery-ui-1.7.1.custom.css" title="ui-theme" />In my web content form i place the script after the asp:Content tag.
<script type="text/jscript"> $(function() { $("#txtDateFrom").datepicker({ changeMonth: true, changeYear: true, buttonText: 'Select Date From', buttonImage: 'images/calendar.gif', buttonImageOnly: true, showOn: 'button' }); }); $(function() { $("#txtDateTo").datepicker({ changeMonth: true, changeYear: true, buttonText: 'Select Date To', buttonImage: 'images/calendar.gif', buttonImageOnly: true, showOn: 'button' }); }); </script>
Finally, when i run my project the "..." is not showing. Normally, when i used web form this "..." will show and i can select a date, but now after switching to web content form, "..." is no longer visible. Thanks
if(you type your code here) { Messagebox.Show("You help me a lot!"); } else { You help me = null; }
klaydze wrote:
$("#txtDateFrom").datepicker({
Using a MasterPage will change the id. You may want to try
$("[id$='txtDateFrom']").
to get the id that ends in txtDateFrom [Edit for correct punctuation]
-
klaydze wrote:
$("#txtDateFrom").datepicker({
Using a MasterPage will change the id. You may want to try
$("[id$='txtDateFrom']").
to get the id that ends in txtDateFrom [Edit for correct punctuation]