473,508 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detailsview loses insert mode contents when Insert fails...

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'?

Jul 23 '06 #1
1 1699
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'?
Jul 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
33072
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
3
8305
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
2
1575
by: Playmaker | last post by:
Hopefully someone else has come across this issue. What I have is a SQL Server 2000 back-end. I've created a simple webform which has both Gridview and DataList controls on it populated with a...
3
5529
by: Developer | last post by:
I use the RichTextBox and sometimes put it into overwrite mode. I'd like the cursor to show whether its in overwrite or insert mode. I often use Cursor.Current = Cursors.WaitCursor and...
0
1680
by: jobs at webdos | last post by:
I have a formview that will either edit or insert records into a database. when I call the page with a query string ?x= its goes to edit mode and loads data from a datasource in the form and load...
4
1757
savanm
by: savanm | last post by:
#! c:/perl/bin/perl.exe use CGI qw(:standard); use DBI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); $dbh = DBI->connect("DBI:mysql:database=perldbi;host=localhost","root",""); $sth =...
0
1478
by: Nirmal Singh | last post by:
How can I (programattically) set a Detailview control into Insert mode and set data to default values? Nirmal
3
21058
by: Don | last post by:
I have a detailsView that I use with a GridView. When a row is selected I show the GridView with a default mode of Edit. This shows my fields with text boxes for changing the data. It also has...
3
2374
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, has anyone ever bound data to a formview that's in Insert Mode? For example, if you had to get default values from the database for a new record? thanks, rodchar
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.