Continuing from the previous post on building a custom control, visit Part 1 here.
We are going to add a sidemenu javascript library to the K2 Smartform Control.
I have chosen the following javascript library, you can download it from here.
Add Javascript Library to Solution
Now lets add those library to the solution project.
Open up the property windows of those files and set them to “Embedded Resources”
NOTE: This is critical for the K2 SmartForm Control, as this will tell the solution to compile the library along with it.
Linking the Javascript Libraries & CSS in the source code
In the SideMenu_Control.cs, open it up and add the following lines of codes.
We are not done yet, the above codes only tells to K2 Smartfrom Custom Control that those are required resources.
We are going to add those following JS and CSS to the code base with the following lines.
Housekeeping
You will notice that the K2 Smartform Custom Control Template generate a whole bunch of codes for you. In this section, we going to remove some stuff to keep it clean.
SideMenu_Control.cs
Remove the following sections that is generated along with the template.
section 1:
section 2:
section 3:
With that all done, we have a clean baseline to work with.
Go to K2 Smartform Custom Control – Part 3