User Control PageLoad even not firing

User Control PageLoad even not firing

am 31.01.2008 11:43:01 von PhilJohnson

Hello,

I have a page that contains a user control that is nested within other user
controls... the nesting is quite deep, not sure exactly how ddep but there is
a control inside a control inside a ... etc.

One of the user controls has a button click that tries to get a reference to
the problematic user control nested inside of it but it throws an exception
saying the user control does not exist, but this problem only happens on a
postback, on first load everything is fine.

When I put a breakpoint in the pageload event handlers of all the user
controls and the page, on first load they all fire, but on a postback the
pageload of the problematic user control does not fire.

Anybody got any ideas?

Thanks in advance,
--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com

Re: User Control PageLoad even not firing

am 31.01.2008 12:20:08 von nemtsev

Hello Phil,

any code samples demonstrating the problem?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


PJ> Hello,
PJ>
PJ> I have a page that contains a user control that is nested within
PJ> other user controls... the nesting is quite deep, not sure exactly
PJ> how ddep but there is a control inside a control inside a ... etc.
PJ>
PJ> One of the user controls has a button click that tries to get a
PJ> reference to the problematic user control nested inside of it but it
PJ> throws an exception saying the user control does not exist, but this
PJ> problem only happens on a postback, on first load everything is
PJ> fine.
PJ>
PJ> When I put a breakpoint in the pageload event handlers of all the
PJ> user controls and the page, on first load they all fire, but on a
PJ> postback the pageload of the problematic user control does not fire.
PJ>
PJ> Anybody got any ideas?
PJ>
PJ> Thanks in advance,
PJ>
PJ> Phillip Johnson (MCSD For .NET)
PJ> PJ Software Development
PJ> www.pjsoftwaredevelopment.com

Re: User Control PageLoad even not firing

am 31.01.2008 12:47:01 von PhilJohnson

Hi Michael,

Unfortunately not... Like I say there are a lot of nested controls and a lot
of code... it is going to be difficult to reproduce a small app with the same
behaviour.

I was hoping somebody else might have experienced the same behaviour and
resolved it.

--
Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com


"Michael Nemtsev [MVP]" wrote:

> Hello Phil,
>
> any code samples demonstrating the problem?
>
> ---
> WBR,
> Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
>
> "The greatest danger for most of us is not that our aim is too high and we
> miss it, but that it is too low and we reach it" (c) Michelangelo
>
>
> PJ> Hello,
> PJ>
> PJ> I have a page that contains a user control that is nested within
> PJ> other user controls... the nesting is quite deep, not sure exactly
> PJ> how ddep but there is a control inside a control inside a ... etc.
> PJ>
> PJ> One of the user controls has a button click that tries to get a
> PJ> reference to the problematic user control nested inside of it but it
> PJ> throws an exception saying the user control does not exist, but this
> PJ> problem only happens on a postback, on first load everything is
> PJ> fine.
> PJ>
> PJ> When I put a breakpoint in the pageload event handlers of all the
> PJ> user controls and the page, on first load they all fire, but on a
> PJ> postback the pageload of the problematic user control does not fire.
> PJ>
> PJ> Anybody got any ideas?
> PJ>
> PJ> Thanks in advance,
> PJ>
> PJ> Phillip Johnson (MCSD For .NET)
> PJ> PJ Software Development
> PJ> www.pjsoftwaredevelopment.com
>
>
>