Building K2 Smartform Control – Part 3

Now with the previous post, we talk about adding our own custom library and cleaning up the template. This is so that we have a clean baseline to start working on.

If you missed the previous post, visit them here.

K2 Smartform Custom Control – Part 1

K2 Smartform Custom Control – Part 2

This post will be relative short and last part of the series.

Today, we are going to cover the main portion of it and some deployment procedure.

SideMenu_Control.cs

Within, K2 Smartform Custom Control project, located the SideMenu_Contro.cs file.

Add the following codes.

13. Adding method to generate HTML

This is required of the Javascript library to render the html within in the K2 Smartform Custom Control.

SideMenu_Script.js

Add the following codes to SideMenu_Script.js

At the top of the file, add the following.

 

14. Javascript file Init the class

 

Next, scroll to the bottom and add the required javascript to invoke the SideMenu.

 

15. Adding Document.Ready method

 

Testing & Deployment

We are all done now, let’s build it and deploy it.

If you are facing the following errors during your build phase, change the .Net framework of the project to 4.5

Error:

16. Error in compiling

 

Solution:

17. Changing the .Net Framework

Now, copy the dll and place them in the Bin folder of your K2 Runtime and K2 Designer and run the .bat file.

Leave a Reply

Your email address will not be published.