Thursday, September 26, 2013

SharePoint DateTime control not loading for some user (DateTimeControl Access denied )

It is a permission issue.
 
DateTimeControl field uses the iframe calender page to render the actual calender. The location of iframe.aspx is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
The problem appeared to be with managed paths in the site collections, the Users with "Contribute access" were accessing the following path:
http://myserver/_layouts/iframe.aspx (Path to Root site collection where user doesn't have access)
 
 
The solution:


DateTimeControl .DatePickerFrameUrl =SPContext.Current.Web.Url+"/_layouts/iframe.aspx ";
Or
DatePickerFrameUrl = "<% $SPUrl:~SiteCollection/_layouts/iframe.aspx %>" DateOnly="true" runat="server" />
~site/ is an equivalent to SPContext.Current.Web.ServerRelativeUrl
~sitecollection/  is an equivalent to SPContext.Current.Site.ServerRelativeUrl

8 comments:

  1. Where should i entry this code ? In my MasterPage or where ?

    DateTimeControl .DatePickerFrameUrl =SPContext.Current.Web.Url+"/_layouts/iframe.aspx ";

    ReplyDelete
  2. Hey Chris,
    Write it in your webpart cs file or ascx file as mentioned in code

    Thanks,
    Satish

    ReplyDelete
  3. hey Satish,

    thank you for youre quick answer. What did you means with ascx ? I have a calendar app and when i want to pick a date it shows me a issue picture and not the calendar datas. Look at this picutre here http://s1.directupload.net/images/131128/sobmjdlj.jpg

    ReplyDelete
    Replies
    1. Is it showing for all users? Is this issue for only this site means is your top level site showing correct iFrame?
      It seems to be issue with loading iFrame. Some files used by Calender control are not loading in browser. Can you check with IE developer tool that path for Date iFrame and type the same in browser,

      In SP 2010 it was http:///_layouts/iframe.aspx

      Delete
  4. Yes i get this issue by every users and by every site.
    The iFrame path looks as follow iframe.aspx?cal=1&lcid=1031&langid=1031&tz=00%3a59%3a59.9991720&ww=0111110&fdow=1&fwoy=0&hj=0&swn=False&minjday=109207&maxjday=2666269&date=28.11.201

    ReplyDelete
    Replies
    1. IS DatePicker.js loading when you access iFrame.aspx in browser?

      http://SiteUrl/_layouts/datepicker.js

      Delete
    2. Yes the datepicker.js is already loading.

      Delete
  5. Thanks a lot dude. It worked for me.

    ReplyDelete

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...