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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Understanding peculiar behavior in first DotNetNuke basic module developmentUnderstanding peculiar behavior in first DotNetNuke basic module development
Previous
 
Next
New Post
4/1/2009 4:50 PM
 

I am writing my first DotNetNuke module.  It's a basic module, no database access required; the module simply processes a contact form and sends an email.  The enter DotNetNuke application is on a test site located at dnn.govoter.org, and the contact form in C# working form is located on the main site at http://www.govoter.org/ContactUs.aspx.  The latter works fine, but in migrating the form to a DotNetNuke module (just to learn module development mainly), aside from using VB.NET, I am running into very peculiar behavior.  You can find the module installed here: http://dnn.govoter.org/AboutUs/ContactUs/tabid/64/Default.aspx

After following the basic steps to setup a module and removing the database connectivity (since all this module does is collect form data and send an email), I have a semi-working system.  I can post the code (ViewContactUs.ascx and ViewContactUs.ascx.vb) if that would be helpful.

The form does work correctly when the appropriate data is filled in, and an email is sent using the DotNetNuke SendMail function.  However, somethings do not behave correctly:

- When an email is successfully sent and I go back to the page, I do not get a fresh form, it says that the email was sent; it is not sending duplicates, it's just not displaying the form.  This logic is handled by making the successful confirmation visible when the email was sent and hiding the form, but in the Page load function, the visibility is reversed
- When the email is not successful (say they enter a bad email address), there is a Throw error clause with an exception message equal to whatever is returned via the SendMail function.  However, this message is never displayed, the form is just refreshed, even though there is a Catch clause with DotNetNuke's builtin ProcessModuleLoadException function.
- When I update this page, the updates are not visible on the web right away.  Something like just adding a line of text to the module, and saving the file; I rebuild the site and refresh the browser, but nothing.  5 minutes later, it will show up.  This really makes debugging problems time consuming--what causes it and how can I get around this?

- It almost seems like the data that is entered into the forms is stored in a session somehow--is this correct?  It's not just apart of the normal postback, but I can enter data, go to a different website or webpage, return to the test site and open the contact form and see the data.  Sometimes I have to click send, but the data will re-appear.  LIke if I enter an incorrect email address and click send, then navigate away and find my way back again, when I click send with a correct email, it is replaced with the original incorrect.  I'm not quite understanding how DotNetNuke achieves this, or what the purpose is of storing all form data somewhere and not overwriting it when the form data changes.

I have a .NET and programming background, but this is my first attempt at doing a basic DotNetNuke module, so any advice you can offer is greatly appreciated.

 
New Post
4/2/2009 1:37 AM
 

Your code probably just don't know when to clear the form and start over.  The easiest way to fix this is to add a button that says "Start Over" and when you click it, that's what happens.

 
New Post
4/2/2009 10:49 AM
 

I don't know of any obivously side-effects that would cause DNN to implicitly. Have you reviewed the code based that you are building on to see if the session is used there at all?

-Eric

 
New Post
4/2/2009 11:00 AM
Accepted Answer 

It sounds like the module is being cached. In the Settings, or the Module Definition, set the Cache Time to Zero or -1, respectively.

 
New Post
4/2/2009 12:50 PM
 

Hello Baatezu:

How awesome! Settings the Cache time to 0 took care of all those oddities.  Thank you very much for pointing me in the right direction.  Out of curiosity--what would this cache feature be useful for?  It defaults to 60 seconds, which is about right in terms of what kind of session "storage" I was experiencing.  Thanks again!

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Understanding peculiar behavior in first DotNetNuke basic module developmentUnderstanding peculiar behavior in first DotNetNuke basic module development


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