Developer forum

Forum » Development » no output

Reply

Hi,


 


Im quite sure this is quite trivial, but since Its waaay too long since I did some module developing, I seem to have forgotton.


 


My problem is that I can get no output at all from my module. I have build the solution, made a case switch call in the default. aspx.cs with the same name as the module, in DW backend I have added the module(same name again) to a paragraph, but nomatter what I get no output. I have also tried simply using e.output("hello world") but no success...


 


So any ideas where to look?


 


Thanks in advance


 


/Regin Madsen


Replies

 
Reply
Did you register your module in the system, using the "Dynamicweb Developer" module?
 
Reply
vme wrote:

Did you register your module in the system, using the "Dynamicweb Developer" module?


Yes the module is registered with the same name as used in the project...
 
Reply
rjm wrote:

vme wrote:



Did you register your module in the system, using the "Dynamicweb Developer" module?




Yes the module is registered with the same name as used in the project...


Have you made the CustomModule "hook" in the CustomModule Event Handler inside the Default.aspx.cs file?
 
Reply
ks wrote:

rjm wrote:



vme wrote:







Did you register your module in the system, using the "Dynamicweb Developer" module?








Yes the module is registered with the same name as used in the project...




Have you made the CustomModule "hook" in the CustomModule Event Handler inside the Default.aspx.cs file?


Yes that too... both where it takes the output from the template, and tried with directly writing e.output = "Hello world"....:-(
 
Nicolai Høeg Pedersen
Reply

Its because of Casing problems.


 


 e.name returns the ModuleSystemName in lower case:


 


public void GetCustomModule(object sender, Dynamicweb.Frontend.CustomModuleEventArgs e)


{


string strModuleName = e.Name;


switch (strModuleName)


{


case "customhello":


CustomHello myCustomHello = new CustomHello();


e.Output = myCustomHello.Hello(e.ParagraphRow, e.Pageview);


break;


case "customdealersearch":


CustomDealersearch.Frontend objModule = new CustomDealersearch.Frontend();


e.Output = objModule.Render(e.ParagraphRow, e.Pageview);


break;


default:


e.Output = "ERROR! \"" + strModuleName + "\" is an unknown module system name";


break;


}


}


 


So you case has to check with the systemname in lower case to display something...


 


Alternatively you can use e.ModuleSystemName instead - it returns the name with the same casing as you typed it in. If you change this, make sure you update existing case statements.

 

You must be logged in to post in the forum