• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

detailsview missing data after unsucceded insert

I have a DetailsView in insert-mode, this contains some text-boxes with validation and a button with insert-commandname - when i click the button (and validation passes) my InsertMethod of my objectdatasource is fired.

My BLL do also have some validation and if this validation is passed everything is good - but if the validation fails I get a problem. If the BLL-validation fails i catch this up in the Inserted-event of my objectdatasource and gives the user an error-message... but the data filled in the detailsview is gone, not because of missing viewstate I guess but probably because it thinks everything in the insert-method was going well.

How can I catch up the BLL error and keep the userinput in the detailsview?
0
keysersoze
Asked:
keysersoze
  • 4
  • 3
1 Solution
 
answer_meCommented:
after showing the message box you can try cancelling the validation event.
0
 
keysersozeAuthor Commented:
I have tried to find a way to do this - but so far I havent found a way to do the trick...
0
 
answer_meCommented:
for cancelling the event you need to use eventobj.cancel=true
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
keysersozeAuthor Commented:
the inserted-event cant be cancelled?
0
 
answer_meCommented:
thats what ..... can't you do validation before this event.
0
 
keysersozeAuthor Commented:
in theory yes - but when the logic is a part of my object it would be double the work to put the logic more places so that is not a solution.
0
 
keysersozeAuthor Commented:
problem solved.

I threw af new applicationerror in my BLL, catching that up in my detailsview ItemUpdated event where I handle ExceptionHandled and KeepInEditMode.
0
 
Computer101Commented:
PAQed with points refunded (125)

Computer101
EE Admin
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now