Handling events from a class in an asp.net page

A

Andy B.

I have a class called Headline. It is a data object that represents a
Headline (news article) for use on a website. It (the headline object) will
have events linked to it. Some of the events will be something like:
1. Saving - just before the Headline gets sent to the database.
2. Saved - just after the Headline got sent to the database
3. Deleting - just before the Headline gets deleted.
4. Deleted - just after the Headline is deleted.

Just for a few examples. There could be quite a few more, but I am still in
the planning stage right now and haven't come up with all of them yet. I
need to know a few things.

1. I have an IHeadline interface that defines what the actual Headline
should look like. This includes the events listed above.
2. I have the Headline itself (concrete object) which requires that I
implement the events listed above in the class itself.

How do I create the object, raise the events above and report back to the
page the Headline is used in on the events results?

I.E. In the Add.aspx page, I need to create a Headline, validate it (Saving
event), save it to the database (Saved event) and report back to the
Add.aspx page the final results (consume the Saved/Saving events of the
Headline object in the Add.aspx page itself). How would you do this using my
examples?
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top