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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Server side validationServer side validation
Previous
 
Next
New Post
1/19/2008 7:07 PM
 

I've wirtten a custom module that collects a Date value (among other things). I have validators in the module to check that the Date is entered (required) and valid (Date type). But, I need to also check that the date is within one of several possible ranges of dates. I do this by checking against a DB table server side in the code behind for the cmdUpdate_Click handler. However, if I find the date is not within any of the valid ranges, I want to return the user back to the page to enter a correct date (without loosing the other data already entered).

My problem is I'm not sure how to do that in DNN. Can I redirect back to the page? Do I throw an exception and tell the user to use the back button? Use AJAX?

 
New Post
1/20/2008 10:26 PM
 

I don't think you need to tell the user to use the back button. As long as your module enables ViewState, your data will be persisted across postbacks. So what you need to do is put a Label control (hidden by default), and shows the Label if there's any errors and put the message in the Label.

Or, you could also use DNN's Framework capability.

 

DotNetNuke.UI.Skins.Skin.AddModuleMessage(yourModule, "Your Error Message", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess);

You can see in the 3rd param; you can change it into either success (green mark), warning, or error.

I suppose you could use this one instead to give consistent message look in your site.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Server side validationServer side validation


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