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

Placeholder and event not fired the first time.

Hi,
I have a web page with a radioButtonList with 3 buttons (B1,B2 and B3) and a
placeholder.
B1 will put an .ascx file (Pl1.ascx) in the placeHolder, B2 will do the same
with Pl2.ascx and B3 with Pl3.ascx.
Each .ascx file has controls that can fire som events(button, dropList...).
When I start the page, B1 is default and every control on Pl1.ascx work very
fine. When I choose B2 or B3 the .ascx file is loaded in the placeholder but
no control works the first time. I have to press twice to fire the event and
they will work after the second time.
When I go back to B1, I have to do the same procedure again: first time
nothing works and after everything work.

Did I do anything wrong???

Pkin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1
Nov 19 '05 #1
3 1795
PKin,

I've noticed this behaviour before with dynamically added controls. Try
giving each of your user controls an id explicitly. In each control's
page_load event put Me.Id = "ControlIDHere". I'm not positive why this
works, but my guess is that when .NET is wiring up events it skips over the
dynamic controls because a routine searches out the control based on ID.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"PKin via DotNetMonster.com" <u10324@uwe> wrote in message
news:55a2412dd0f97@uwe...
Hi,
I have a web page with a radioButtonList with 3 buttons (B1,B2 and B3)
and a
placeholder.
B1 will put an .ascx file (Pl1.ascx) in the placeHolder, B2 will do the
same
with Pl2.ascx and B3 with Pl3.ascx.
Each .ascx file has controls that can fire som events(button,
dropList...).
When I start the page, B1 is default and every control on Pl1.ascx work
very
fine. When I choose B2 or B3 the .ascx file is loaded in the placeholder
but
no control works the first time. I have to press twice to fire the event
and
they will work after the second time.
When I go back to B1, I have to do the same procedure again: first time
nothing works and after everything work.

Did I do anything wrong???

Pkin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1

Nov 19 '05 #2
Hi Justin,
This is very strange but it works. Thanks a lot.

Pkin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1
Nov 19 '05 #3
Pkin,

YW.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"PKin via DotNetMonster.com" <u10324@uwe> wrote in message
news:55a36cdb8a70b@uwe...
Hi Justin,
This is very strange but it works. Thanks a lot.

Pkin
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1

Nov 19 '05 #4

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

Similar topics

1
by: Navin | last post by:
which event is fired when a browser is closed. i want to call asp page which deleet some files on the server. i tired using onunload event but it aslo get fired when a page is refreshed. the thing...
2
by: Asit | last post by:
In JavaScripts checks for an onChange event against the value of the textbox at the time of the last onChange event. Since an onChange Event never fired after you changed the text first time ,...
4
by: blue | last post by:
I have a drop-down list, a radio button list and a submit button. I'm adding these controls to a table and I'm adding the table to a Placeholder. I'm adding it to the Placeholder because I don't...
2
by: Liqun Xu | last post by:
Hallo NG, I created a Button with Click-Event dynamically: System.Web.UI.WebControls.Button bt_1 = new Button(); bt_1.Click += new EventHandler(bt_1_click); and I implemented the Funktion...
1
by: ItNerd | last post by:
I have a placeholder in an aspx page that loads a control (.ascx). The aspx page's page_load event loads the placeholder and sets its visibility to false. There is a datagridcommandevent that...
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");...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
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,...
3
by: Aussie Rules | last post by:
Hi, I want to be able to to have an event fired within my application at a certain time on certain days (such as 2am Monday, Wednesday and Friday) as well as other timers that fire an event...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...

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.