473,395 Members | 1,756 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,395 software developers and data experts.

Problem with loading UserControls dynamically.

I've a form where I load two user controls dynamically.

User Control-1 has a no.of dropdowns and based on the
selection I typically
populate a datagrid in the user control-2,

Also the I could be loading a different usercontrol-2
based on the selections in usercontrol-1.

Also I thought of passing the selection values through
public properties of the usercontrols without
resorting to querystrings or session variables.

So I've decided to load the UserControl-1 in Page_Load and
Load UserControl-2 in Page_Prerender
So that the postback on usercontrol-1 is processed and the
properties of usercontrol-2 are set
properly before it loads.

This works just fine, until I've a requirement where I
need to post back from the datagrid in user_control2.
Those events just won't fire ( probably because I'm always
loading the usercontrol-2 in PreRender ).

On the other hand, If I try to load both user controls in
page load, UserControl-2 would not know any thing
about the usercontrol-1's server controls Current
selection.

Can some one straighten out this design problem for me ?
Appreciate your help.

-Sundar
Nov 18 '05 #1
1 1443
Hi,

try to use the override OnInit method and page_load. using those methods
won't harm postback behavior.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2

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

Similar topics

0
by: Hendrik W. Hansen | last post by:
I'm working on a WebForm, that through some tabs can load and contain a number of different "plugin" UserControls, all derived from the same "plugin" super class - a bit like the IBuySpy portal. ...
1
by: Brett | last post by:
Hi, Here's a strange one: I have built a single page model for a website, that uses 3 panel controls which load usercontrols dynamically, based on the querystring PageMode parameter that you...
1
by: kanones | last post by:
Hi - I am seeing some performance degradation when I am loading a control dynamically onto a page with multiple other dynamical controls using Page.LoadControl versus dragging and dropping it...
0
by: Phl | last post by:
Hi, I am trying to create an webform which loads usercontrols dyanamically. I know exactly what to load for some of these controls but for some, I dont want to load it until the user has press a...
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");...
3
by: navyliu | last post by:
I have raised a discussion about assembly unloading.But we can't get a final solution. Since we cannot unlaod a assembly,Is there any reference about this indicate that this problem won't make...
2
by: chandu | last post by:
Hai all, i am developing an applciation which loads all configuation plugins in MainForm when clicks on corresponding plugin button. let me explain : SomePlugin is a class library projects ...
5
by: marfi95 | last post by:
I have a form that has a left and right panel. In the left panel is a treeview. The right panel I want to change dynamically based on the type of node selected. What I'm doing is loading the...
1
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
(I've been away from web app programming for a while. Most of my experience has been in 1.1. Now I'm using vb/Dot Net 2.0) Please explain a couple of things. First, I have a simple-minded...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.