Dotnetnuke module development (1)

Source: Internet
Author: User
Tags dnn dotnetnuke
ArticleDirectory
    • Summary:

Reference: dotnetnuke advanced programming 4 Chapter 12

Development Environment: vs2008, dotnetnuke5.4.2 _ source, and sqlserver express 2005

Installation Tool: dotnetnuke_community_05.04.02_starterkit.vsi

Today, I started learning about my dotnetnuke module. I started with the helloworld module. I used John's video tutorial to practice the development of the helloworld module. Today I use starterkit for operations. Open the dotnetnuke5.4.2 _ source solution, as shown in

Right-click http: // localhost/dotnetnuke_community/-> Add a new project, and select dotnetnuke dynamic module in "My templates. As shown in.

At this time, the Web browser will load a document, explain the steps to be performed in detail, rename the modulename folder and the module name helloworld. This ensures that no name conflict occurs during the development of additional modules on the website. The modification includes the following three parts.

1./App_code/modulename/App_code/helloworld

2./desktopmodules/modulename/Topics topmodules/helloworld.

3. Make the following changes in the web. config file to correspond to the helloworld added in app_code.

<System. Web>

<Compilation>

<Codesubdirectories>

<Add directoryname = "helloworld"/>

</Codesubdirectories>

</Compilation>

</System. Web>

The module creation is complete. The following task is to register the helloworld module in the dotnetnuke system. The operation procedure is host-> moduledefinition, as shown in.

The creation module contains the Crete module from: new, control, and manifest. Three forms.

New: Creates a new module in the dotnetnuke system, instead of vs2008.

Control: Creates a specified web control.

Manifest: manually add the dnn module definition. This is when the dnn module has been created in vs2008. Manifest is used here, as shown in.

However, the following error occurs when you add a module.

Then I copied the helloworld folder under app_code and renamed it yourcompany. helloworld. When we create a module in starterkit, we rename modulename to helloworld. However, in the helloworld. dnn file, we will find that the module names contain yourcompany.

View the helloworld module in the module definition, as shown in:

We will find that the module name is yourcompany. As shown in. All are automatically loaded. Manual loading is not required.

We added the helloworld module instance on the home page. The result is as follows:

It seems to be related to the yourcompany error. Therefore, perform the following test to add a module.

Add the hello module and rename "hello" under the app_code folder and the reply topmodule folder to yourcompany. Hello. The modification is also made in Web. config. The error is as follows:

The control is not found. I think it is because hello is renamed yourcompany. Hello IN THE topmodule directory. Therefore, change yourcompany. Hello under the topmodule directory to hello. The following error occurs:

This error indicates that the Stored Procedure DBO. yourcompany_gethellos does not exist. The module is still not created successfully.

Now, you only need to modify web. config and app_code and add yourcompany. If your topmodule is used, do not add yourcompany. Shows the operation process.

However, the following error occurs when loading a module.

The problem is the same as that of the hello module. The stored procedure is not found, so it may be because the SQL script is not executed. Then, I run the 01.00.00.sqldataprovider script under host> SQL.

However, the following error occurs during script execution.

However, for this error, you only need to refer:Error in manually inserting 01.00.00.sqldataprovider script in dnnYou can solve this problem. After resolving the error, add the module on the home page. This will add the module successfully.

Summary:

The dnn module is created in three steps:

1. create a module under vs2008. During the creation process, the app_code directory and web. you must add yourcompany to the module name in config, while yourcompany does not need to be added to the file where the module under the parent topmodule directory is located.

2. register the module in manifest mode in the dotnetnuke System

3. Run the 01.00.00.sqldataprovider script.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.