SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that there is a lot of small tutorial in order to modify the sharepoint rendering templates and allow the removal of toolbar items etc.

I've been fiddling with the DefaultTemplate.ascx in the CONTROLTEMPLATES folder of your sharepoint server.

I've been trying to copy one of the rendering templates and simply tweak it, by giving it a different ID. (all for the sake of css magic on certain views)

Once that is done, I went through the Calendar list view .aspx and modified the webpart to use the CalendarViewStyle of my new templates.

This unfortunately didn't work and threw a big "An unexpected error has occured"

I revert to the original and everything works. While looking through the DefaultTemplate, there is another rendering template defined for calendars, which I try to apply using the same CalendarViewStyle, and once again I'm baffled to see the above error, even though this is a built-in sharepoint template.

My question is then how can one easily modify these Sharepoint Rendering templates without breaking the functionality and be able to apply any of the templates to their liking?

share|improve this question

you can open DefaultTemplate.ascx, copy the rendering templates that you need to modify, and create an other ascx file,ex. MyCalendarTemplate.ascx, paste the code you copy from DefaultTemplates.ascx, DO not missing the header of DefaultTemplate.ascx . copy to MyCalendarTemplate.ascx too.

and then, modify the code in MyCalendarTemplate.ascx, remember that DO not modify the id of each rendering template !!! and you needn't to modify the webpart.

hope it helps

share|improve this answer
Thanks Eric I've done something similar - What bugs me is that I should be able to switch the CalendarViewStyle using one of the SP declared template in the DefaultTemplate.aspx - yet this fails. I've followed a couple of tutorials that explained the above, but always missed the part where the GUID gets created and how to tell Sharepoint to load that ascx file. Any idea/tips on how to do this? Thanks! – TeckniX Dec 27 '10 at 22:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.