Thursday, August 17, 2017   Login
You are here: Example Code » How to extend IWebCF for your own modules  
Tutorial: How to extend IWebCF for your own modules

1. Install IWebCF module on your DotNetNuke development site, using the typical module install method.

2. Install the IWebCF code snippets that can be downloaded here. For instructions on these view: How to install IWebCF code snippets.

3. Open the DotNetNuke site in Visual Studio (or Visual Web Developer Express)

Open DotNetNuke

4. Under the IWebCF folder, that is under the App_Code folder right-click on the ServiceMethods folder and select Add New Item...

Add New Item

5. Choose Class for the template and enter IWebTabManagerMethods.vb for the name

Select Item

6. The file will be created

7. Delete the default code generated and use the IWebCF Service snippet that you installed previously.

IWebCF Service Snippet

8. Replace IWebService with IWebTabManager.

Replace IWebService

9. Replace MethodName with GetTabNamesOnPortal

Replace MethodName

10. Replace String with List(Of String)

Replace String

11. Replace the IWebMethod Attribute values

Replace IWebMethod Attributes

With these values

Replaced IWebMethod values

 

12. Copy and past the following into the method after the Dim results As New List(Of String) line

                Dim tabs As ArrayList = tabCtrl.GetTabs(msg.Header.PortalID)

                For Each t As Entities.Tabs.TabInfo In tabs

                    If Not t.IsAdminTab AndAlso Not t.IsSuperTab Then

                        results.Add(t.TabName)

                    End If
                Next
        

13. After saving this file, it will be compiled into the CoreService class and exposed like the other IWebCF methods in the edit screen. You will also be able to see your method by viewing: /DesktopModules/IWebCF/CoreService.svc

Putting the class file in the correct place

In order to work the class file containing your new web method must be placed in the App_Code/IWebCF/ServiceMethods folder.

To do this you create an entry such as this in the .dnn file that is contained in your module package

[app_code]../IWebCF/ServiceMethods
IWebTabManagerMethods.vb

The ../IWebCF/ in the path causes the file to be placed in the proper directory.

 

To download the code from this tutorial and a client application to test the new method please click here.

    
Home  |  Screen Shots  |  Example Code  |  Installing  |  Download  |  Project
Copyright 2006-2009 by OpenLightGroup.net   |  Privacy Statement  |  Terms Of Use