Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsAnnouncementsAnnouncementsHow to convert developed web site to DNN site?How to convert developed web site to DNN site?
Previous
 
Next
New Post
8/8/2011 3:08 AM
 
jitesh Dhuravala wrote:
Hi,


Finally i got solution for my question, how to add already developed website content in DNN Module.

so, Here best solution for this question.....

Right-click on the "DesktopModules" folder and select "New Folder"
Name the folder "DevelopedSite"
Next, right-click on the "DevelopedSite" folder and select "Add New Item...
In the "Add New Item" box that opens:
  • Click on "Web User Control" under "Visual Studio Installed Templates".
  • Enter "DevelopedSite.ascx" in the "Name" box.
  • Make sure the "Place code in a separate file" box is checked.
  • Click the "Add" button.
  • The "DevelopedSite.ascx" file will be created in the "DevelopedSite" folder under the "DesktopModules" folder.
  • Clicking the "plus" icon next to the file will display the associated code behind file "DevelopedSite.ascx.vb" (or "DevelopedSite.ascx.cs").
  • Double-click on the "DevelopedSite.ascx" file and it will open up in the main editing window. Right now the page will be blank.Click the "Source" button at the bottom of the page to switch to source view.
  • Enter the following code:

    VB:

    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="DevelopedSite.ascx.vb"
    Inherits="DesktopModules_DevelopedSite_DevelopedSite" %>
    Search: 
     

    
        
    
        

    C#:

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="DevelopedSite.ascx.cs" Inherits="DesktopModules_DevelopedSite_DevelopedSite" %>
    Search: 
     

    
        
    
        
    Click the "Design" button at the bottom of the page to switch to the design view.
  • Double-click on  "DevelopedSite.ascx.vb" (or "DevelopedSite.ascx.cs")
  • Replace all the code with the following code:
    VB:
    Imports DotNetNuke
    Imports System.Web.UI
    Imports System.Collections.Generic
    Imports System.Reflection
    Imports DotNetNuke.Security.PortalSecurity
    Partial Class DesktopModules_DevelopedSite_DevelopedSite
    Inherits Entities.Modules.PortalModuleBase
    Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If Not Page.IsPostBack Then
     ShowData("")
    End If
     
    End Sub
    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
    ShowData(txtSearch.Text)
    End Sub
    Private Sub ShowData(ByVal SearchString As String)
    Dim mySqlString As New StringBuilder()
    mySqlString.Append("SELECT FriendlyName, Description ")
    mySqlString.Append("FROM {databaseOwner}{objectQualifier}DesktopModules ")
    mySqlString.Append("WHERE Description like '%' + @SearchString + '%' ")
    mySqlString.Append("ORDER BY FriendlyName")
    Dim myParam As SqlParameter = New SqlParameter("@SearchString", SqlDbType.VarChar, 150)
    myParam.Value = SearchString
    Me.GridView1.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), myParam), IDataReader)
    Me.GridView1.DataBind()
    End Sub
    End Class

    C#:

    using DotNetNuke;
    using System.Web.UI;
    using System.Text;
    using System.Collections.Generic;
    using System.Reflection;
    using DotNetNuke.Security;
    using System.Data.SqlClient;
    using System.Data;
    using DotNetNuke.Data;
     
    partial class DesktopModules_DevelopedSite_DevelopedSite: DotNetNuke.Entities.Modules.PortalModuleBase 
    { 
     protected void Page_Load(object sender, System.EventArgs e) {
     if (!Page.IsPostBack) 
     {
     ShowData("");
     }
     }
     
     protected void btnSearch_Click(object sender, System.EventArgs e) {
     ShowData(txtSearch.Text);
     }
     
     private void ShowData(string SearchString) {
     StringBuilder mySqlString = new StringBuilder();
     mySqlString.Append("SELECT FriendlyName, Description ");
     mySqlString.Append("FROM {databaseOwner}{objectQualifier}DesktopModules ");
     mySqlString.Append("WHERE Description like \'%\' + @SearchString + \'%\' ");
     mySqlString.Append("ORDER BY FriendlyName");
     SqlParameter myParam = new SqlParameter("@SearchString", SqlDbType.VarChar, 150);
     myParam.Value = SearchString;
     this.GridView1.DataSource = ((IDataReader)(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), myParam)));
     this.GridView1.DataBind();
     }
     
    }
  • Select BUILD from the menu bar and select "Build Page".
  • The page should build without errors.
now, Finally follow step as you do for module put in your page. like : host-->Module Defination---> Create Module---> Edit module Defination-->Add Control --> Update it.

and now module ready for display at your desired page.

Thanks for conversation.
 

Thanks & Regards
Jitesh Dhuravala

 

 
New Post
10/22/2013 2:09 PM
 
well explained @jitesh Dhuravala....can you please let me know whether can we use a different database for our Module rather than using DNN7.0 default database?
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsAnnouncementsAnnouncementsHow to convert developed web site to DNN site?How to convert developed web site to DNN site?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out