Elczar Adame's Shared Points on SharePoint

Archive for October, 2013

Visual Web Part and jQuery in Office 365/SharePoint Online


Below are the steps I have followed to quickly incorporate a jQuery widget in a Visual Web Part deployed in Office 365/SharePoint Online. I have used the Accordion widget of jQuery UI for this demonstration.

The output of this demonstration.

1. Let us start by creating a SharePoint sandboxed solution in our Visual Studio. It contains a Visual Web Part and a Module that holds the .js file for our visual web part.

2. The .ascx file of our visual web part basically contains references to the jQuery .js and .css files. The Protoype.js file is a javascript for our visual web part. Moreover, the .ascx contains the div necessary for the accordion widget we are using in this demonstration.

3. The Prototype.js file contains the function for the accordion in this demonstration.

4. Finally, let us build our solution, deploy it in the solution gallery of our SharePoint Online, and then let us activate it to enjoy the incorporation of jQuery and visual web part in our SharePoint Online.

Hope this would help.

Advertisements

Tag Cloud