I needed to add a calender control in a ASP Grid View. As the ASP.Net grid view is not collapsible I have tried the jquery calender. By referencing to the enter link description here
Although this works when the server tags are placed in a form tag when I add this to a page which inherited from a master page and with ASP MainContentPlaceHolder's the calender does not get triggered.
Please share me what I am doing wrong as the drop down with the calender does not shown.
The Id of your textbox is changed by ASP.net.
You can either set a static ID so the client Id will be the same as the server ID:
<asp:Textbox ID="txtDate" runat="server" ClientIdMode="Static" />
Or put a class on the textbox like txtCalendar
, and use the class when creating the calendar in jquery:
$('.txtCalendar').datepicker();
...
<asp:Textbox ID="txtDate" runat="server" CssClass="txtCalendar" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.