473,668 Members | 2,375 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 1703
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
33130
by: Sathyaish | last post by:
If fopen fails, is there a way to know why?
3
8311
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 are a couple of people selling components... but that is not really an option for me... So, I took the plunge and modified the "WebUIValidation.js" file to make it happen... After tracing through file, I figure it out. It was actually pretty...
2
1581
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 SqlDataSource. Okay, simple enough, that all works fine. I have also enabled inserting and editing on these controls. This is a very cool feature of 2.0 and it works quite well. Functionally I am able to do everything such as inserting and...
3
5538
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 therefore need to change the cursor to show the overwrite/insert mode in such a way that when the Cursor.Current is reset after the need for the wait cursor ends, the cursor resets to the overwrite cursor or insert cursor as appropriate.
0
1686
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 data into the dropdown (from another datasource) with no problem. I'm using the same dropdownlist tag for both edit and insert, however the dropdown only get populated in insert mode... <asp:DropDownList ID="RouteCodeList" runat="server"...
4
1761
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 = $dbh->prepare('select * from foo1'); $sth->execute(); print header; print start_html('Newgen'); print h1("DBI SAMPLES");
0
1485
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
21074
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 the update and cancel buttons. Now I need to put the DetailsView into Insert mode when a button is clicked. In the button clicked event handler, in the code behind, I change to insert mode with this code:...
3
2377
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
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8374
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8575
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7398
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2784
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 we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.