By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,760 Members | 1,557 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,760 IT Pros & Developers. It's quick & easy.

Placeholder and event not fired the first time.

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.