Friday, December 31, 2010

Register Javascript using SharePoint Feature

You can register JavaScript and CSS without change your SharePoint sites master page.Follow below steps to register JavaScript in master page.

  • Open VS 2010 & create one blank SharePoint 2010 Project.

  • Then Add New Item & select SharePoint 2010’s “Empty Element” and give name “JQueryRegisterElement” as below.

  • Then right click on project and add “SharePoint Mapped Folder” & select “Control Templates” as below.Then add one Usercontrol in this Control Templates folder.

  • Now open Element.xml and add below code for register JavaScript.

Then open UserControl

  • Then Right click on project, Deploy it & open SharePoint Site. You will see below popup.

Happy Coding !!!

No comments:

Post a Comment