By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,002 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,002 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?
Apr 8 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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/...s/default.aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"yuchang" wrote:
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?

Apr 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.