473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PlaceHolder and UserControls

I have a UserControl loaded into a PlaceHolder and I have a button
there which is suppose to load another UserControl into the same
PlaceHolder and hide the previous one. Why does the events of the
controls that are inside the second UserControl doesn't work the first
time I try to rise them?

Sep 28 '06 #1
2 1425
Are you adding the controls to the placeholder at runtime? If you are,
then the controls need to be re-added to the placeholder on each
subsequent postback. Otherwise postback data will not be available,
events will not be wired etc.. here is a link that describes the
lifecycle of asp.net, it helped me understand what you need to do:

http://msdn2.microsoft.com/en-us/library/ms178472.aspx

hope that helps!

Sean

David wrote:
I have a UserControl loaded into a PlaceHolder and I have a button
there which is suppose to load another UserControl into the same
PlaceHolder and hide the previous one. Why does the events of the
controls that are inside the second UserControl doesn't work the first
time I try to rise them?
Sep 28 '06 #2
Yes, I'm adding those controls at runtime, and I re-add them on each
subsequent postback, and still, I doesn't work.
Please, can you send me a simple project where I can see how can I
solve this problem.
thank you very much.

Oct 2 '06 #3

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

Similar topics

2
by: Hai Nguyen | last post by:
Hi all I'm trying ing to create usercontrols dynamically and add them into a placeholder. During a postback i got the following error " Failed to load viewstate. The control tree into which...
1
by: John | last post by:
Hi all, My web app uses 3 different placeholders on one page and dynamically load usercontrols into them. That's all fine but now I have two situations which puzzle me: 1. I have a sub-folder...
4
by: Anders K. Jacobsen [DK] | last post by:
Hi I have some common UserControls i want to share between to sites (on the same mashine but on diffrent virtual paths). right now i have on solution file with aprox 10 projects. 2 of these is...
9
by: Anders K. Jacobsen [DK] | last post by:
Hi I have this that adds some usercontrol (UCTodays.ascx) to a placeholder foreach(A a in B){ UCTodays ucline = (UCTodays )LoadControl("UCTodays.ascx");...
1
by: Joe | last post by:
Hello All, I have a user control which is composed of a label and a dropdownlist. In my code I add the user control to a placeholder on the webform. Now I want to be able to retrieve the...
2
by: Thomas Bandt | last post by:
Hi all. I am filling some stuff into a PlaceHolder Control in my WebForm, i.e. UserControls and WebControls. So far so good. Now I want to manipulate the HTML output of this control and its...
0
by: seigo | last post by:
Hello, I faced with the following problem. I have a PlaceHolder on a page and a few UserControls which have custom events, for instance: public delegate void SelectHandler(object sender,...
4
by: Nathan Sokalski | last post by:
In several of my UserControls I add properties. If I access these properties in the CodeBehind of the pages that use the controls, I recieve an error when compiling. The reason for this is because...
7
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.