Developer forum

Forum » Development » Step by Step How-to

Step by Step How-to


Reply

Hi all


 


Does anybody have a step-by-step guide for adding new modules to the environment?


 


I have been on the course but have forgotten (*imbarrased*)


 


I have installed the dw-package with the vbclassic and I am trying to add/see the CustomModules that come with the example. This is where I fail.


 


Kind regards,


Thami


 


 


Replies

 
Reply

Hi Thami,


You need to register them in the Admin interface. Try this:


1. Log in to /Admin


2. Click Modules


3. Select the Dynamicweb Developer module


4. Click New module and register your module as follows:


Name: Your Custom Name


SystemName: SystemName


Paragraph: Checked


Access: Checked


You can leave the other fields empty. If your module has its own /Admin interface, supply a path to it in the Script field. E.g. /CustomModules/SystemNameOfYourModule/SomePage.aspx


5. Log out and log back in again


Now you should be able to see your module using the Insert module button of a paragraph.


Hope this helps,


Imar

 
Reply

Thank you so much for your help.


 


I am proud to anounce that my only stupidity was that I didn't log out and back in again !! *S*


 


Thanks again ... I will probably be back with some db-acces questions.


 


Kind regards,


Thami

 
Reply

Hahaha, no problem. And you're welcome....


Imar

 
Reply

Hi again


 


Now the admin part of my module is working, but when I try to insert the module in a paragraph it gives me an error with unknown module system name.


 


What is the module system name and where do I find it?


 


On a page called list.aspx I have:



 


And in Dynamicweb Developer/Systemname I have called it DeviceList.


 


What am I doing wrong?


 


Kind regards,


Thami

 
Nicolai Høeg Pedersen
Reply

Go to default.aspx.vb/cs and change the CustomModuleHandler class found in the code to manage your module.

 
Reply


Hi Nicolai




Thank you for your help. But ..







It keeps saying: ERROR! "devicelistview" is an unknown module system name







Now I went to the CSharpClassic folder and changed the CustomModuleHandler to:




case "devicelistview":




 


and the list.aspx contains:






It keeps saying "Error "devicelistview" is an unknown ...."




To verify that it is the right default.aspx.cs I am editing I changed the phrase "Error" to "Fejl"




 




It still says "Error"




I then changed the Application/Default.aspx.cs from "Error" to "Fejl"




 




It still says "Error"






Where is the right default.aspx.cs to edit ??




 




Thami




 
Nicolai Høeg Pedersen
Reply

Make sure that the Systemname is correct and beware of casing problems. Just do good ol' debugging.

 
Reply

>> It still says "Error"


>> I then changed the Application/Default.aspx.cs from "Error" to "Fejl"


 


Probably a stupid question, but did you rebuild the solution in Visual Studio?


 


Imar

 
Reply

Hi again


I finally got it working. It turned out that there was some VS2005 error. I recreated the entire CSharpClassic example from scratch, adding all the references, creating the aspx-files and then it worked. I discovered the VS2005 error when I tried to add pages it gave me an error : "values does not fall within the expected range". I think it did something wrong in the conversion.


 


Anyway now it is working and finally giving sense.


 


I now have another question. The page is showing up fine, and I can link to an administrationpage through the script-link. But when I add the module to a paragraph it doesn't show me the "Remove module" button or the module settings.


 


Isn't this enough in the DeviceListPage_Edit.aspx? :


 


<%@ Page AutoEventWireup="false" CodeBehind="DeviceListPage_Edit.aspx.cs" Inherits="DeviceList.DeviceListPage_Edit" Language="C#" %>


<%@ Register Assembly="Dynamicweb.Controls" Namespace="Dynamicweb.Controls" TagPrefix="dw" %>







edit settings page





I appreciate your help


 


Kind regards,


Thami

 
Reply

Take a look at this:


 


<%@ Page AutoEventWireup="false" CodeBehind="DeviceListPage_Edit.aspx.cs" Inherits="DeviceList.DeviceListPage_Edit" Language="C#" %>


...



 


Your page name doesn't line up with the system name. For a module's Edit page to be found you must call it SystemName_Edit.aspx which in your case would be DeviceList_Edit.aspx.


Hope this helps,


Imar

 
Reply

Hi again


Thank you for your help but it doesn't do the trick:


<%@ Page AutoEventWireup="false" CodeBehind="DeviceList_Edit.aspx.cs" Inherits="DeviceList_Edit" Language="C#" %>


<%@ Register Assembly="Dynamicweb.Controls" Namespace="Dynamicweb.Controls" TagPrefix="dw" %>










Text



 


Codebehind:


using System;


using System.Data;


using System.Configuration;


using System.Collections;


using System.Web;


using System.Web.Security;


using System.Web.UI;


using System.Web.UI.WebControls;


using System.Web.UI.WebControls.WebParts;


using System.Web.UI.HtmlControls;


using Dynamicweb;


public partial class DeviceList_Edit : System.Web.UI.Page


{


protected void Page_Load(object sender, EventArgs e)


{


Int32 ParagraphID = Base.ChkNumber(Base.Request("ID"));


Properties properties = new Properties();


if (Base.ChkString(Base.Request("ParagraphModuleSystemName").ToString()) != String.Empty)


{


//The module is being attached - set default values


properties.set_Value("HelloText", "Hi Thami");


}


else


{


properties = Base.GetParagraphModuleSettings(ParagraphID, true);


//True for making this Version and workflow compatible


}


HelloText.Value = properties.get_Value("HelloText");


}


}

 
Nicolai Høeg Pedersen
Reply

Hi


 


Specify the name attribute for your input field:


name="HelloText" class="std" type="text" runat="server"/>

 
Reply

Hi Nicolai


Thanks but sorry. I added the name attribute, recompiled, removed module, logged out, logged in, added module, logged out, logged in, added page + paragraph, but the module tab in the paragraph still comes up blank. Only options are save, save and close, cancel, help.


 


I also have another question. Now that everything works except the above, how do I upload the .aspx files, the new default.aspx, and the dll to the website?


 


Kind regards,


Thami

 
Nicolai Høeg Pedersen
Reply

 Make sure the file is placed here: /CustomModules/DeviceList/DeviceList_Edit.aspx

 
Reply

Cheers


When I recreated the project from scratch I placed the project outside the CustomModules folder. Now when I moved everything back in it worked.


Thanks


 


And how about the upload part?


 


Kind regards,


Thami

 
Nicolai Høeg Pedersen
Reply

When hosting here, you would have a ftp account for that website. If not, login to partner extranet and create a case in the helpdesk asking for an account. Then you would have access to all you need to overwrite.

 
Reply

I will do .. Thank you

 

You must be logged in to post in the forum