DotNetNuke Installation and Usage Part 2

Rama Sagar
Posted by in C# category on for Beginner level | Points: 250 | Views : 4612 red flag

Christoc module development templates allow us to easily start up a new development project for DotNetNuke. They do require that you already have DotNetNuke running in your development environment.

Introduction


This article explains us to how to create a DNN Module in Visual Studio 2012.In this context here we use Christoc Template for the development..

Hope you have gone through my Part 1 Article

Let’s start the Creation of DNN Module through step by step procedure:-




  • Step 2:- Now open Visual studio 2012 In Admin mode and Create new project and click on DotNetNuke  and select DotNetnuke 7 C# Complied Module Template and provide the path which we have created earlier (C:\websites\dnndev.me\Desktop Modules\) and uncheck  Create directory for solution  as shown below



  • Step 3:-Now let’s change the Properties of the Module as shown

 Right click on project and select properties and navigate to web and provide Start Url as http://dnndev.me/ and local IIS web server as http://dnndev.me/desktopmodules/ModuleExample and Override application root  url as  http://dnndev.me/





  •  Step 4:-We can see our solution as shown below
  

  • Step 5:-Let’s test our module by inserting a small label message and aspx textboxes and buttons in the view as shown

<table>
        <tr>
            <asp:Label ID="lblexample" ForeColor="#0000" Font-Bold="true" Font-Size="Large" runat="server" Text="welcome to Dake Dot net nuke"></asp:Label>
            <td>First Name:</td>
            <td>
                <asp:TextBox ID="txtFirstName" runat="server">
                </asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="rfvFirstName"
                    runat="server" forecolor="Red"
                    ControlToValidate="txtFirstName"
                    ErrorMessage="First Name can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>Last Name:</td>
            <td>
                <asp:TextBox ID="txtLastName" runat="server">
                </asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator1" runat="server" forecolor="Red"
                    ControlToValidate="txtLastName"
                    ErrorMessage="Last Name can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>

        <tr>
            <td>UserName:</td>
            <td>
                <asp:TextBox ID="txtUserName" runat="server">
                </asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator
                    ID="rfvUserName"
                    runat="server" forecolor="Red"
                    ControlToValidate="txtUserName"
                    ErrorMessage="UserName can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>

        <tr>
            <td>Password:</td>
            <td>
                <asp:TextBox ID="txtPwd" runat="server"
                    TextMode="Password">
                </asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="rfvPwd"
                    runat="server" forecolor="Red" ControlToValidate="txtPwd"
                    ErrorMessage="Password can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>

        <tr>
            <td>Confirm Password:</td>
            <td>
                <asp:TextBox ID="txtRePwd" runat="server"
                    TextMode="Password">
                </asp:TextBox>
            </td>
            <td>
                <asp:CompareValidator ID="CompareValidator1"
                    runat="server" forecolor="Red"
                    ControlToCompare="txtRePwd"
                    ControlToValidate="txtPwd"
                    Operator="Equal"
                    ErrorMessage="Password and confirm password do not match"
                    SetFocusOnError="True">
                </asp:CompareValidator>
            </td>
        </tr>

        <tr>
            <td>Gender:</td>
            <td>
                <asp:RadioButtonList ID="rdoGender"
                    runat="server">
                    <asp:ListItem>Male</asp:ListItem>
                    <asp:ListItem>Female</asp:ListItem>
                </asp:RadioButtonList>
            </td>
            <td>
                <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator2"
                    runat="server" forecolor="Red"
                    ControlToValidate="rdoGender"
                    ErrorMessage="Gender can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>

        <tr>
            <td>Address:</td>
            <td>
                <asp:TextBox ID="txtAdress" runat="server"
                    TextMode="MultiLine">
                </asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="rfvAddress"
                    runat="server" forecolor="Red"
                    ControlToValidate="txtAdress"
                    ErrorMessage="Address can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>

        <tr>
            <td>Email ID:</td>
            <td>
                <asp:TextBox ID="txtEmailID" runat="server">
                </asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator3"
                    runat="server" forecolor="Red"
                    ControlToValidate="txtEmailID"
                    ErrorMessage="Email can't be left blank"
                    SetFocusOnError="True">*
            </asp:RequiredFieldValidator>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblMsg" runat="server"></asp:Label>
            </td>
            <td>
                <asp:ValidationSummary ID="ValidationSummary1"
                    runat="server" ShowMessageBox="True"
                    ShowSummary="False" />
            </td>
        </tr>

        <tr>
            <td>
                <asp:Button ID="btnSave" runat="server"
                    Text="Sign Up" OnClick="btnSave_Click" />
                <asp:Button ID="Button1" runat="server" Text="cancel" />

            </td>
        </tr>
    </table>

 Let’s build the module make sure that we must compile only the module and not the entire solution as shown below

After successful build we will find a zip file of our Module at   C:\websites\dnndev.me\DesktopModules\ModuleExample\install

  • Step 6:- Now let’s install the module debug the Project in Release mode as shown


Conclusion

So far we have learned how to code a module..In part 3 we will see how to install the Extension,create a page and assign our module to the page..

Reference

http://www.christoc.com/Projects/Module-Development-Templates
Page copy protected against web site content infringement by Copyscape

About the Author

Rama Sagar
Full Name: RamaSagar Pulidindi
Member Level: Silver
Member Status: Member,MVP
Member Since: 12/30/2012 1:51:40 AM
Country: India
ramasagar
http://www.ramasagar.com
A Software Profesional working in Microsoft .NET technologies since year 2008, and I work for Dake ACE. I am passionate about .NET technology and love to contribute to the .NET community at Dot Net Funda

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)