Do something on update, insert or cancel

D

David C

I want to run the same code after insert, update or cancel buttons clicked
on a FormView. I thought the ItemCommand would do it but that did not work
entirely as I have a Databind() for the GridView to show the new data but it
did not. Is it because the ItemCommand runs before the update is actually
done? How can I accomplish this? Thanks.

David
 
E

Eliyahu Goldin

You can use events of the datasource. SqlDataSource has useful events like
Inserting, Inserted etc.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


David C said:
I want to run the same code after insert, update or cancel buttons clicked
on a FormView. I thought the ItemCommand would do it but that did not work
entirely as I have a Databind() for the GridView to show the new data but
it did not. Is it because the ItemCommand runs before the update is
actually done? How can I accomplish this? Thanks.

David


__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4312 (20090806) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4312 (20090806) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

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

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top