Hi,
The sharepoint date picker is not working for Visual webparts created in VS 2012 (SP 2013).
In my visual webpart, I added the form digest, and then the sharePoint date control.
<script type="text/javascript" src="/_layouts/15/datepicker.js"></script><SharePoint:DateTimeControl ID="dtDate" runat="server" DateOnly="true" />
I get the "/ error in Application". Many websites are saying to add the below line to the datepicker:
<SharePoint:DateTimeControl ID="dtDate" runat="server" DateOnly="true" DatePickerFrameUrl="<% $SPUrl:~sitecollection/_layouts/15/iframe.aspx %>" />
But adding the "DatePickerFrameUrl" gives error in the "InitializeControl()" method available in OnInit().
Error: The name InitializeControl does not exist in the current context.
I have checked this:
http://developmentsimplyput.blogspot.in/2013/04/sharepoint-datetimecontrol-issue-when.html
but did not solve the issue. Also creating a root site for just a DatePicker control is not an option for me.
Has anybody found a solution to this?
How to use the SharePoint datepicker in visual webpart for SP 2013?
Thanks