Hi,
I do not know if you already got an answer to this question but in
order to 'wire' the PreRender event handler using VS.net you need to:

1) Open the Page (say myPage.aspx)

2) Open the Properties dialog for that page by right clicking anyhwere
on the page and selecting the Properties menu item (last item on the
list)

3) Most likely the combo box under the Properties title will show the
HTML tag that correspons to the area where you right clicked on step
2). That's ok, scroll down the ComboBox and look for the entry that
represents the page it should look something like:
'myPage.aspx System.Web.UI.Page'

4)As soon as you select that item you will see the Events icon
(thunderbolt).
Just click on it and the Property page will show you an area where you
can enter the name of the function that will handle the event.


I hope this helps

Happy .NETing

Armando


roger <rsr@rogerware.com> wrote in message news:<Xns939F9C0535F6Drsrrogerwarecom@204.127.199. 17>...
> I've got an aspx page and a class implemented in a code behind file.
>
> I have a PreRender method in my class, in order to
> do whatever needs to be done *after* all of the various
> post back event handlers have been executed.
>
> Stop me now if there's a better way to do that than adding
> a PreRender event handler on the page...
>
>
> Now, the part I don't get is this:
>
> The way to add the PreRender event is to put something like:
>
> this.PreRender += new System.EventHandler(this.Page_PreRender);
>
> in the page's InitializeComponent method, similar to the way the PageLoad
> method is registered.
>
> The mystery to me is this comment which VS.NET attaches to
> the InitializeComponent method reads
>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
>
> This begs the question, how does one add the method then?
>
> What's even more exciting is that I've seen VS.NET, on several
> occasions, delete the entire contents of the InitializeComponent
> method and leave it completely empty.
> Heck, I didn't need all those event handlers anyway:(
>
>
> As I write this, I'm thinking maybe the right thing to do is
> to add this in the OnInit method, after (or before) the call
> to InitializeComponent is made.
>
> That method doesn't claim or appear to be used by VS.NET.
>
> Am I on the right track here?
>
> Thanks.