Home All Groups Group Topic Archive Search About

Pre_Init for User Control is not firing in ASP.NET 2.0

Author
30 Dec 2005 9:52 PM
Michael
Hi,

I'm using ASP.NET 2.0. I have code like:
protected void Page_PreInit(object sender, EventArgs e)
{
    // do something
}

The Page_PreInit is not firing. Is it supposed to work for User Control? I
should not need to explicitly wire the event, do I? I don't for Page_Load
for example, and Page_Load works just fine.

Thanks,
Michael

Author
30 Dec 2005 10:16 PM
Brock Allen
Controls don't have the PreInit event; only the page does.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Show quote
> Hi,
>
> I'm using ASP.NET 2.0. I have code like:
> protected void Page_PreInit(object sender, EventArgs e)
> {
> // do something
> }
> The Page_PreInit is not firing. Is it supposed to work for User
> Control? I should not need to explicitly wire the event, do I? I don't
> for Page_Load for example, and Page_Load works just fine.
>
> Thanks,
> Michael
Author
30 Dec 2005 11:37 PM
Michael
Thanks Brock.


Show quote
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:b8743b1163b198c7db7bdaec39be@msnews.microsoft.com...
> Controls don't have the PreInit event; only the page does.
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>> Hi,
>>
>> I'm using ASP.NET 2.0. I have code like:
>> protected void Page_PreInit(object sender, EventArgs e)
>> {
>> // do something
>> }
>> The Page_PreInit is not firing. Is it supposed to work for User
>> Control? I should not need to explicitly wire the event, do I? I don't
>> for Page_Load for example, and Page_Load works just fine.
>>
>> Thanks,
>> Michael
>
>

AddThis Social Bookmark Button