Detailsview loses insert mode contents when Insert fails...

Discussion in 'ASP .Net' started by cannontrodder, Jul 23, 2006.

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

    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
    cannontrodder, Jul 23, 2006
    1. Advertisements

  2. 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!
    cannontrodder, Jul 25, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.