Print Page | Close Window

AspDataSource reporting errors to the UI

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=916
Printed Date: 19-Apr-2025 at 4:36pm


Topic: AspDataSource reporting errors to the UI
Posted By: jcdk
Subject: AspDataSource reporting errors to the UI
Date Posted: 15-Aug-2008 at 2:29am
Hi,
 
I have a situation in my ASP application, where the ASPDataSource (or rather the AdapterManager) may discover a problem with the data being inserted. I can not discover this problem with validators, because it is a rather complex calculation involving other data in the database. The checks have been build into the model.
 
My problem is how I inform the user about the problem. Is there a way that I can have the AdapterManager tell the ASPDataSource that there is a problem, and have the datasource show a messagebox or something similar?
 
The apllication uses an ASP FormView to hold the controls, and I have considered to have the FormViews OnItemInserting event actually copy the data to an Entity and perform the test, but I find that a very messy solution as it mixes UI with datamanipulation, so I would much rather have the ASPDataSource (or AdapterManager) report back somehow.
 
Any help appriciated.
 
Best regards
Jesper Carstensen



Replies:
Posted By: davidklitzke
Date Posted: 18-Aug-2008 at 8:18am
Jesper,
 
I totally agree with you that modifying the UI to perform validation is, in general. not the best way to perform verification.  You really want the verification to happen independently of the UI.  In Windows Forns, we are fortunate to have an Error provider which not only works well with .NET controls, but third party controls as well.   In ASP.NET, there us no such mechanism, so there is no way for IdeaBlade Verification to send error messages to an error provider.  If you know of such  an error provider, I woulde love to know about it.  Remember also that the AspDataSource is designed to not only work with .NET Web Controls, but also thirf party Web Controls from Dev Express, Infragistics, and Telerik.



Print Page | Close Window