473,794 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control PageLoad even not firing

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
Jan 31 '08 #1
2 1975
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
PJHello,
PJ>
PJI have a page that contains a user control that is nested within
PJother user controls... the nesting is quite deep, not sure exactly
PJhow ddep but there is a control inside a control inside a ... etc.
PJ>
PJOne of the user controls has a button click that tries to get a
PJreference to the problematic user control nested inside of it but it
PJthrows an exception saying the user control does not exist, but this
PJproblem only happens on a postback, on first load everything is
PJfine.
PJ>
PJWhen I put a breakpoint in the pageload event handlers of all the
PJuser controls and the page, on first load they all fire, but on a
PJpostback the pageload of the problematic user control does not fire.
PJ>
PJAnybody got any ideas?
PJ>
PJThanks in advance,
PJ>
PJPhillip Johnson (MCSD For .NET)
PJPJ Software Development
PJwww.pjsoftwaredevelopment.com
Jan 31 '08 #2
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
PJHello,
PJ>
PJI have a page that contains a user control that is nested within
PJother user controls... the nesting is quite deep, not sure exactly
PJhow ddep but there is a control inside a control inside a ... etc.
PJ>
PJOne of the user controls has a button click that tries to get a
PJreference to the problematic user control nested inside of it but it
PJthrows an exception saying the user control does not exist, but this
PJproblem only happens on a postback, on first load everything is
PJfine.
PJ>
PJWhen I put a breakpoint in the pageload event handlers of all the
PJuser controls and the page, on first load they all fire, but on a
PJpostback the pageload of the problematic user control does not fire.
PJ>
PJAnybody got any ideas?
PJ>
PJThanks in advance,
PJ>
PJPhillip Johnson (MCSD For .NET)
PJPJ Software Development
PJwww.pjsoftwaredevelopment.com
Jan 31 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2563
by: Tim Thomas | last post by:
Hi, I am very new to .NET and am in the process of building my first web application. I will briefly describe what i am trying to achieve: I have a system where suppliers register their details, their locations, and then add themselves to categories. Each category requires additional info from the suppliers, this additional category info is stored in its own DB table. a suppliers may add themselves to as many categories as required....
1
7588
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
3
1546
by: Philip Poole | last post by:
Hello everyone, Please help with this as it is driving me up the wall and it is urgent i finish this page, this is the first time I have used User Controls and I think I must have completly misunderstood a basic point. I have a number of user controls which are used to make up my page. One control is a series of tabs which are created dynamically from a database. When someone clicks on a tab, the page reloads and the tabs that was...
6
3383
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display the user control - select user control button, event fires - select web form button to display...
0
2294
by: jonelling | last post by:
I am having a problem where the page load event is not being fired for certain user controls that I load dynamically in placeholders. Here is what I'm doing in brief, with full test code supplied at the bottom. In my controlling .aspx page, in the page_init() sub, if not postback, I load two user controls and place them in placeholders. This works and a trace statement in each user control's page load handler is executed on initial...
4
1385
by: Wayne Wengert | last post by:
I have a form that has a cbo set to TabIndex 0 (it is the only item set to tabindex 0). On page Load if I step through the code that cbo LostFocus event fires after other initializations are completed and after the LostFocus event completes, that cbo gets focus and the form opens? Why is that LostFocus event firing? Any hints on how to debug this? Wayne
1
1271
by: Dood | last post by:
I have a page that has a tab control which toggles which user control is loaded into a placeholder. The user controls that are loaded into this place holder have other user controls in them, making 3 levels. When I select a drop down list that is in the 3rd level user control, it causes a post back, but only the postback event on the main page (1st level) fires, nothing else happens in any of the user controls in the 2nd and 3rd level. Any...
2
1201
by: edsuslen | last post by:
I am trying to migrate from asp to asp.net and having problem replacing include with user control. On every page we have include asp that have some common asp code that I need to run before the page code kicks in, but user control code is always running after the page code. I am even registering and placing user control before my page initialization, but still it's running after. <%@Register TagPrefix="FindSessionUC"...
2
6366
by: tshad | last post by:
In VS 2008, I have 2 pages, one aspx page and one ascx page. The PreRender event is not firing on the Contol page. The aspx page starts out: <%@ Page Language="VB" AutoEventWireup="true" Trace="true" CodeFile="TakeSurveyTest.aspx.vb" Inherits="TakeSurveyTest" %> And the ascx page starts out:
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9035
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.