Detailsview loses insert mode contents when Insert fails...

C

cannontrodder

I am using a custom business object to deal with inserting, editing,
deleting and adding new users to my site which uses the membership
class.

When I add a new user, it can fail due to the user already existing in
the membership data store. This is fine, I catch the exception in my
business object and gracefully deal with it.

What is frustrating is that the detailsview does not remember the
values it contained before the insert failed. This means that the user
must re-enter all the data rather than just edit the offending item.

How can I get it to maintain state in these instances?

A method I have thought may work is instead of going into insert mode,
going into edit mode and binding it to an object with no data in. But
how do I change the text of the edit mode 'save' button to the word
'insert'?
 
C

cannontrodder

I'll reply to my own post so this is in the archive.

If you use a custom validator on the username, you can ensure the user
does not exist before adding.

Hope this helps someone!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top