Forum


HomeHomePremiumPremiumDevelopmentDevelopmentException Handling and displaying message in DAL2Exception Handling and displaying message in DAL2
Previous
 
Next
New Post
2/20/2014 4:26 PM
 
Hi,   I am working with DNN7 and would like to handle exception in DAL2, I am currenlty logging exception in EventLog but I also want to display error message on the page. How can I do that? I am using Exceptions.ProcessModuleLoadException(ctrl, ex, true); the third argument is a bool flag for display message but its not working, however it is logging exception in eventlog. Which is not helping during development as I have to go to event viewer each time to see the error message. Any help would be appreciated. Thanks
 
New Post
2/26/2014 10:40 AM
 

If I understand the situation right, it the problem you are running into is how to pass the exception information back to the GUI since the error happens in a repository.

One way I am getting information out of the repository is through session variables. 

Inside the repository you can write to the session by using:

HttpContext.Current.Session[SESSION_KEY] = ***your stuff here****;

Put your error message, or whatever information you need, into the session.  In the module, you can check for the existence of the variable in the session.  If there is something, you know you should print it.

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentException Handling and displaying message in DAL2Exception Handling and displaying message in DAL2



Try FREE
30 days money back guaranteed