SharePoint: сбой DateTimeControl в веб-части SP2013

Я реализовал SharePoint: DateTimeControl в очень простой веб-части.

<SharePoint:DateTimeControl ID="dtStartdate" runat="server" DateOnly="true" />

Проблема в том, что когда я нажимаю на элемент управления, он отображает исключение

Server Error in '/' Application.
Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 
[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.SharePoint.Utilities.SPUtility.GetThemedImageUrl(String originalUrl, String themeKey) +199
   Microsoft.SharePoint.WebControls.DatePicker..ctor() +1460
   Microsoft.SharePoint.WebControls.SPDatePickerControl.InitDatePicker() +44
   Microsoft.SharePoint.WebControls.SPDatePickerControl.set_MinJDay(Int32 value) +25
   Microsoft.SharePoint.ApplicationPages.DatePickerFrame.Page_Load(Object sender, EventArgs e) +1708
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.LoadRecursive() +94
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2935

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

введите описание изображения здесь

Любые советы или помощь в решении этой проблемы приветствуются, спасибо!


person Eric Herlitz    schedule 15.01.2013    source источник


Ответы (1)


Я знаю, что прошло много времени с тех пор, как вы спросили об этом, но, только что решив что-то очень похожее, я подумал, что поделюсь своим (простым) решением.

Убедитесь, что в корне веб-приложения создано семейство сайтов.

Я работал над веб-частью в http: // webapp / sites / mysitecollection и имел указанную выше ошибку. Глядя на http: // webapp, я получил 404, поэтому я создал корневую коллекцию сайтов, и теперь datepicker в моей коллекции сайтов работает нормально.

person Chris McKinley    schedule 04.06.2013