473,761 Members | 8,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.c om
http://www.dotnetmonster.com/Uwe/For...p-net/200510/1
Nov 19 '05 #1
3 1814
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.c om" <u10324@uwe> wrote in message
news:55a2412dd0 f97@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.c om
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.c om
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.c om" <u10324@uwe> wrote in message
news:55a36cdb8a 70b@uwe...
Hi Justin,
This is very strange but it works. Thanks a lot.

Pkin
--
Message posted via DotNetMonster.c om
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
4696
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 should work in netsacpe also. please advise me . regds, Navin Mahindroo
2
12160
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 , suppose we put the same value in the text box then no event is fired. If we put some other value then it became fired... It wouldn't fire if we put the same value... I don't want to use onBlur etc... Isthere any solution with onChange Event...?
4
2561
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 know exactly where the table will be located on the page until runtime. Before the form control table is added to the Placeholder, I'm adding a whole bunch of tables to the Placeholder. This is a flowchart program and I have multiple action boxes...
2
2354
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 bt_1_click in which I created a second Button dynamically too. System.Web.UI.WebControls.Button bt_2= new Button();
1
3054
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 removes the placeholder and reloads it. After the datagridcommandevent is fired, there is a linkbutton that shows within the placeholder that when clicked, sends info to the ascx's codebehind via postback. I have to click this linkbutton twice in...
9
2452
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"); ucline.Initializecontrol(line,alternate); Placeholder1.Controls.Add(ucline); }
0
2440
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 (http://support.microsoft.com/kb/810852), but then I realized that the hotfix mentioned was in .Net v1.1, which I am using. I took the sample from that article and recreated the situation I see in my application. (Code included below.) If you run the...
0
1552
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, SelectEventArgs e); public event SelectHandler OnSelect; protected void Page_Load(object sender, EventArgs e)
3
5004
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 based on a time interval (such as every 3 minutes). Out of the box there is the old timer1, which would cover the second scenario, but is there a way to have the first timer done?
0
9376
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9988
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.