473,395 Members | 1,696 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.

dynamic user control event handling (VS.NET 2003 Ent)

Thanks in advance to anyone who can help :)

I've got a placeholder control WITHIN A USER CONTROL that has its contents
dynamically added and removed at runtime by a regular .aspx page.

At runtime, the placeholder control adds a dropdownlist where I would like
it to redirect the user to a different page dependent on the selection they
make from the dropdownlist.

I've tried writing the delegate and the event handler both in the
UserControl's code behind page (placing the delegate in the Page_Load) AND
the .aspx page the user control shows up in..and IT DOES NOT RESPOND to the
event

BTW, in the .aspx page the dynamic dropdownlist is created in the OnInit
method of the page.

Is this proper? I've read so many articles and I'm not sure as to why it is
not responding. In this situation, should the event be coded in the
usercontrol or the page it will show in?
Nov 28 '05 #1
2 3812
The dropdownlist must be re-added and the event rehooekd on postback.
What's the mechanism for determining which dynamic control is loaded? Is it
placed within a Page.IsPostBack?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Developer_Software" <De***************@discussions.microsoft.com> wrote in
message news:E7**********************************@microsof t.com...
Thanks in advance to anyone who can help :)

I've got a placeholder control WITHIN A USER CONTROL that has its contents
dynamically added and removed at runtime by a regular .aspx page.

At runtime, the placeholder control adds a dropdownlist where I would like
it to redirect the user to a different page dependent on the selection
they
make from the dropdownlist.

I've tried writing the delegate and the event handler both in the
UserControl's code behind page (placing the delegate in the Page_Load) AND
the .aspx page the user control shows up in..and IT DOES NOT RESPOND to
the
event

BTW, in the .aspx page the dynamic dropdownlist is created in the OnInit
method of the page.

Is this proper? I've read so many articles and I'm not sure as to why it
is
not responding. In this situation, should the event be coded in the
usercontrol or the page it will show in?

Nov 28 '05 #2
Thanks, Karl:

Rather than go through those complications, I simply wrote all of the event
handling within the usercontrol itself. Thanks anyway-

"Karl Seguin" wrote:
The dropdownlist must be re-added and the event rehooekd on postback.
What's the mechanism for determining which dynamic control is loaded? Is it
placed within a Page.IsPostBack?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"Developer_Software" <De***************@discussions.microsoft.com> wrote in
message news:E7**********************************@microsof t.com...
Thanks in advance to anyone who can help :)

I've got a placeholder control WITHIN A USER CONTROL that has its contents
dynamically added and removed at runtime by a regular .aspx page.

At runtime, the placeholder control adds a dropdownlist where I would like
it to redirect the user to a different page dependent on the selection
they
make from the dropdownlist.

I've tried writing the delegate and the event handler both in the
UserControl's code behind page (placing the delegate in the Page_Load) AND
the .aspx page the user control shows up in..and IT DOES NOT RESPOND to
the
event

BTW, in the .aspx page the dynamic dropdownlist is created in the OnInit
method of the page.

Is this proper? I've read so many articles and I'm not sure as to why it
is
not responding. In this situation, should the event be coded in the
usercontrol or the page it will show in?


Nov 28 '05 #3

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

Similar topics

8
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form. Users are going through the form, clicking the...
1
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...
2
by: Wee Bubba | last post by:
my user control (usercontrol1.ascx) is added dynamically into a placeholder on page_load. within usercontrol1.ascx there is a button. When a user presses this button I want the page to reload with...
1
by: ronniek | last post by:
Hi, I'm trying to load a WebUserControl (.ascx) into a PlaceHolder but I keep getting an exception that the Page Tree ViewState is modified. If I load the WebUserControl by the designer (not...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
4
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up ...
1
by: Stanley Cheung | last post by:
Dear all, how can I pass a parameter to dynamic user control? As I know we can pass parameter into traditional user control. e.g: add pageid into user control and write a property from user...
3
by: c676228 | last post by:
Hi all, I have an event in user control email to handling email change when user want to change the input for email address. Here it is In email.ascx.vb: Protected Sub UpdateEmail(ByVal sender As...
5
by: Andrew Robinson | last post by:
I have a page that can load a number of different user controls. Each of these user controls inherits from a common base class and the controls are loaded based on application state, status, etc...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.