Adding Event to C# VS 2003

T

tshad

I normally use DW to create my pages and never have to worry about events.
They are just created.

In DW, all my code and design are on one page (no code-behind).

When I create a Page_PreRender event - it just works.

Sub Page_PreRender(ByVal Sender As Object, ByVal E As EventArgs)
....
End Sub

But in VS 2003 if I add the following lines

private void Page_PreRender(object sender, EventArgs e)
{
}

It doesn't generate the event.

I have to then go over to InitializeComponent Event and add the following
line:

this.Load += new System.EventHandler(this.Page_PreRender);

Why is this?

I don't have to add a special handler in DW.

Is there an easier way to add an event like this?

Thanks,

Tom
 

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

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top