Problem with VS 2003 and Events

by tshad on 11/1/2007 11:23:00 AM One of the differences with building one page style in DW and code behind in
VS 2003 is you have to declare the events (apparently).

For some reason my events will disapper.

For example:

I have the the following events in my InitializeComponents section:

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

and after making a couple of changes in my Properties page for my DataGrid,
I kept coming up with a blank screen (DataGrid was not filling).

After putting a break on the function that was called in the Page_Load
function, I found that it never went to the break.

When I looked in my InializeComponents section, I found this:

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

My Page_Load event had disappeared. I can't accidently delete it since the
InitializeComponents section is hidden.

So what deleted it?

Thanks,

Tom


 

Re: Problem with VS 2003 and Events

by tshad on 11/1/2007 11:30:00 AM It seems to do it ANYTIME I change the DataGrids properties in the Property
window.

When I open the property window and just select a property, it doesn't do
it. But when I actually change one of the properties and immediatly look at
the code window (even while the Property window is still open), the event
line is gone. This only seem to be the Page_Load event that it takes out.

Tom

"tshad" <tfs@dslextreme.com> wrote in message
news:OmYL47OHIHA.4916@TK2MSFTNGP02.phx.gbl...
> One of the differences with building one page style in DW and code behind
> in VS 2003 is you have to declare the events (apparently).
>
> For some reason my events will disapper.
>
> For example:
>
> I have the the following events in my InitializeComponents section:
>
> this.Load += new System.EventHandler(this.Page_Load);
> this.Load += new System.EventHandler(this.Page_PreRender);
>
> and after making a couple of changes in my Properties page for my
> DataGrid, I kept coming up with a blank screen (DataGrid was not filling).
>
> After putting a break on the function that was called in the Page_Load
> function, I found that it never went to the break.
>
> When I looked in my InializeComponents section, I found this:
>
> this.Load += new System.EventHandler(this.Page_PreRender);
>
> My Page_Load event had disappeared. I can't accidently delete it since
> the InitializeComponents section is hidden.
>
> So what deleted it?
>
> Thanks,
>
> Tom
>