Skip to main content

Posts

Showing posts from September, 2013

Adding Custom CSS and JS on SharePoint MasterPage

I tend to come across this at times and I always lookup on the internet on how to do this. So I'm writing this blog post so that I can refer back to this next time: Here is how we can add a custom CSS on the SharePoint 2010 MasterPage: < SharePoint:CssRegistration name =" <% $SPUrl:~SiteCollection/Style Library/HREuHome.css %> " After =" corev4.css " runat =" server "/ > The above script could be added right above the closing HEAD tag </head> Here is how we can add a custom javascript file and its better to add it right inside the <form> tag: < asp:ScriptManager id =" ScriptManager " runat =" server " EnablePageMethods =" false " EnablePartialRendering =" true " EnableScriptGlobalization =" false " EnableScriptLocalization =" true ">   < Scripts >   <asp:ScriptReference Path=" <%$SPUrl:~SiteCollection/Style Library/footer.js%> &q

DataSourceID is either missing or set to an empty string

This is one of those funny times where the error you see hasn't got much to do with what is actually wrong! DataSourceID is a parameter in the dataview webpart and it is empty in the view which errors out and the one which works perfectly okay. Check this screenshot of a DataView webpart which works fine: Most of the time it would would be an error in the html tags within your XSL style sheet. Hard to troubleshoot but one of the ways is to copy the entire webpart code from SharePoint Designer on to a Visual Studio - New - XSLT file and see if there any errors highlighted by Visual Studio. This could also be done in SharePoint Designer but its more of a pain that way.