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
    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'?
    cannontrodder, Jul 23, 2006
    #1
    1. Advertising

  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 wrote:
    > 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'?
    cannontrodder, Jul 25, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    435
  2. Nirmal Singh
    Replies:
    1
    Views:
    1,301
    Richard Humphrey
    Oct 13, 2010
  3. Don
    Replies:
    3
    Views:
    1,182
  4. Feege
    Replies:
    0
    Views:
    432
    Feege
    Dec 20, 2005
  5. Replies:
    0
    Views:
    255
Loading...

Share This Page