Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Detailsview loses insert mode contents when Insert fails...

Reply
Thread Tools

Detailsview loses insert mode contents when Insert fails...

 
 
cannontrodder
Guest
Posts: n/a
 
      07-23-2006
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'?

 
Reply With Quote
 
 
 
 
cannontrodder
Guest
Posts: n/a
 
      07-25-2006
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'?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting DetailsView into Insert Mode with default values Nirmal Singh ASP .Net 1 10-13-2010 06:22 PM
DetailsView programmatically enter Insert Mode Don ASP .Net 3 03-24-2008 09:42 AM
Detailsview insert mode seetharajiv@yahoo.com ASP .Net Web Controls 0 08-30-2007 04:58 PM
How to set some default values in DetailsView in insert mode? ned.balzer@gmail.com ASP .Net Web Controls 0 06-21-2006 04:30 PM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM



Advertisments