main-it
-
3/12/2009 9:18:02 AM
RE:Developing custom controls/web parts in a separate solution
Hi Boris, here I am with some news about my initial post. Finally I was able to obtain the desired solution. I'm going to write the main steps I used to start developing such a solution.
1. Create a new Visual Studio Project (ASP.NET Web Application); 2. Add references to CMS.*.dll bins (or those DLL you will need in your project); 3. Remove default pages (I don't need them); 4. Add a global.asax file and edit the code behind adding a call to CMS.CMSHelper.CMSContext.Init() and to CMS.VirtualPathHelper.VirtualPathHelper.RegisterVirtualPathProvider() in Application_Start method (I'm going to verify if I really need that). 5. Now add a new web control (mycontrol.ascx) and write the required code. For example I simply added a DataGridView object, binded it to an external datasource. Also, in the Page_Load event, I added standard Kentico code to check user authentication and permissions. 6. Compile it.
At this point I simply copied MyProject.dll to the /bin folder in the Kentico site. The I took the control (mycontrol.ascx) and placed it in a subfolder inside the Kentico site. Finally I started CMS Site Manager and I created a new WebPart linked to my control.
Now, starting CMSDesk, I'm able to use the control within my site and the control behaves as expected.
I need to make some more test but this first result is very interesting and it opens new ways to collaborate with external developers.
The reasoning behind this approach is the same described by Kentico in integrating third party controls with some additionals steps to be able to make calls to Kentico APIs.
Kind regards, MRK
|