How to know whether success or not in FormView Control inserting.

G

Guest

Hi,
Using the FormView control is very efficient. But I want to do some
action,like showing a success message or redirect to another page, after
inserting, updating and deleting. How do I get these message?
 
G

Guest

The FormView raises events at the end of updating (ItemUpdated), Inserting
(ItemInserted) or Deleting (ItemDeleted).

The signature of the delegate functions for all of those events passes a
parameter of type FormViewInsertedEventArgs, FormViewUpdatedEventArgs or
FormViewDeletedEventArgs, respectively.

Each of those eventargs type has a property named AffectedRows that would
give you an indication of the success of the operation. You can redirect or
display a message on the page during handling one of those events.

You can also process the equivalent events on the DataSource object. For
example, after inserting in this sample on my website I set the FormView
display to the newly inserted record by handling the Inserted event on the
ObjectDataSource
http://www.webswapp.com/codesamples/aspnet20/dependentlists/default.aspx
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top