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

Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack

a uscontrol test.ascx have a dropdownlist web control the dropdownlist's
AutoPostBack property is set "true"
but when i use Loadcontrol("test.ascx") in a aspx fiel's Page_Load event the
dropdownlist which in the ascx can not run good it can not autopostback and
can not call the OnselectedChange event. help me pls~~
Nov 17 '05 #1
1 5310
I assume you are using a dynamic control--

Be SURE the control exists when you post back to your page.
if the control doesn't exist when the page posts back, it
cannot receive the vent.

so, load the control regardless of the value
of "IsPostBack".

2ndly, do you add a handler when the control is first
rendered? you need to assign some routine to handle the
event:

AddHandler myControl.MyEvent Addressof MyEventHandler
unless you are using member-level "WithEvents" variable
for your control.
-----Original Message-----
a uscontrol test.ascx have a dropdownlist web control the dropdownlist'sAutoPostBack property is set "true"
but when i use Loadcontrol("test.ascx") in a aspx fiel's Page_Load event thedropdownlist which in the ascx can not run good it can not autopostback andcan not call the OnselectedChange event. help me pls~~
.

Nov 17 '05 #2

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

Similar topics

2
by: sunil | last post by:
Will the state of a dynamically loaded control preserved in transitions between aspx pages hosting the control.? thanks
10
by: Umut Tezduyar | last post by:
It seems, it is caching it. The following code is an example for it. How can avoid from this. override void OnLoad (sender and eventargs) { Control control = this.LoadControl (path);...
4
by: Christopher | last post by:
I am trying to load a UserControl which inherits from one of our customer classes which in turn inherits from UserControl. We use Page.LoadControl() from within our ASP.NET pages to load these...
8
by: Sam Kuehn | last post by:
How do I accomplish the fallowing (is it even possible). Say I write a UserControl "MyControl.ascx". Now I use LoadControl("MyControl.ascx"). But I really want MyControl to require parameters in...
6
by: John | last post by:
Hi all, I am using dynamic user controls within my web app and these controls are loaded into placeholders via the LoadControl method. My problem is this: I have usercontrolA loaded into a...
1
by: Andreas | last post by:
Hallo zusammen, ich kämpfe seit Tagen mit folgendem Problem und habe bisher leider keine Lösung gefunden. Vielleicht kann mir jemand helfen: Ich möchte auf einer Seite (test.aspx) ein...
5
by: Andreas | last post by:
Hello, I have the following problem: I want to add to my site (test.aspx) one (1) UserControl (customer.ascx) several times - dynamically with a placeholder. As well I want to hand off...
2
by: Sekhar | last post by:
Hi all I have one page WebForm1.aspx and one user control UserControl.ascx My WebForm1 has a Place holder and dropdownlist with autopostback property set to true. The user control also has a...
0
by: DC | last post by:
Hi, thankfully this new method exists in the 2.0 Framework, in 1.1 it was more complicated to dynamically load a WebControl with PartialCaching. I did not try it, but I take it for granted that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.