viernes, 27 de enero de 2012

SharePoint 2010 Developer FAQs

Q. How do I deploy my custom CSS file in Sharepoint 14 hive?

To simply deploy a CSS file you can use “Sharepoint mapped folder” available in vs 2010.
Quick steps -
Create a empty project
Add new item -> select “SharePoint mapped folder”
Select the folder in 14 hive where you want to add the CSS file into. The folder structure then will be added to your Solution.
Next, add your CSS under the desired folder in your solution and deploy.


Q. How do I display a popup when users visits my SharePoint site for the first time.

In SharePoint 2010 you can use JavaScript  client om to display a popup when the use visits your Sharepoint site.  You have to create a property in user profile which will be set when the user clicks on ok on your popup for the first time. The after, you check this property each time the user logs in and you don’t display the popup for us if the property is set already.

Q. How can I deploy my custom master, layouts and aspx page in Sharepoint 2010 site.

You can add a custom Master page,layouts page, and your aspx pages using the module elements file in your VS 2010 solution.

Q. Where do you add logs for you Sharepoint application like webpart of receiver? What’s the preferred location?

Most of the developers like to write into the ULS logs. In Sharepoint 2010 you can write logs to the ULS logs(loc) using the Diagnostics Service.  For example -

SPDiagnosticsService diagSvc = SPDiagnosticsService.Local;
diagSvc.WriteTrace(0, new SPDiagnosticsCategory(“Add category”, TraceSeverity.Monitorable,EventSeverity.Error),TraceSeverity.Monitorable,”Writing to the ULS log: {0}”,new object[] { “Error in WebPart!”});

Q. I need to create a bunch of list and libraries when a new site is created. How can I do it?

You can use the WebProvisioned event receiver which is Fired after the site has been created and is fully provisioned(asynchronous). You can add the new lists and libraries in this WebProvisioned event receiver.



No hay comentarios:

Publicar un comentario