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

Event Handling Problem

Hi Ther

I have an ASP.NET user control which contains a test panel defined as follows

<asp:Panel ID="TestPanel" Runat="server" /

In the OnInit method I designate an event handler to handle the user controls PreRender event and in the PreRender event handler I create a button as follows

Button _Button = new Button()
_Button.ID = "PRButton"
_Button.Text = "Pre-Render Test"
_Button.Click +=new EventHandler(_Button_Click)
TestPanel.Controls.Add(_Button)

If I add similar code into the Page_Load, the button event successfully fires and is captured by the _Button_Click event handler

However if I click on the button added within the PreRender event handler the debugger steps into the Page_Load and PreRender event handlers but ignors the Button Click event handler

Can any one tell me why this is and also how I can potentially solve this problem

Simply moving the code into the Page_Load is not an option, I have other code that must remain within the Pre_Render event handler

Thank

Dou

Nov 22 '05 #1
0 1048

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

Similar topics

0
by: Doug Holland | last post by:
Hi Ther I have an ASP.NET user control which contains a test panel defined as follows <asp:Panel ID="TestPanel" Runat="server" / In the OnInit method I designate an event handler to handle...
3
by: Ashok Kumar K | last post by:
Hi all, Where can I get some insight on using the __hook, __unhook, event_source and event_receiver for specifically COM events. The documentation given in MSDN is very minimal. I have the...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
1
by: Paul Johnson | last post by:
I have problems with eventhandlers when dynamically moving controls in ASP.NET. The controls are loaded into a placeholder on postback so that the eventhadlers can fire. If a move evet or...
9
by: Sridhar | last post by:
Hi, I have created a web page which includes a place holder. I also have a dropdown list in that webpage. when I select one of the choices in that dropdown list, It will load a user control...
9
by: yb | last post by:
Hi, In IE I usually check for event objects in event handlers with something like: handler = function( e ) { if( !e ) var e = window.event; .... }
1
by: Mark Gilkes | last post by:
I have a DataGrid which I am adding to the page dynamically at the Init stage of the page load. The DataGrid has AutoGenerateColumns turned off, has BoundColumns and is bound to a DataView for...
5
by: dynamo | last post by:
Hi everyone.I'm new to wxpython.And i have a little problem.I tried to run the following wxpython app code in IDLE for python25: import wx import os import re def z(a): for i in...
4
by: StepanM | last post by:
Problem with event handling in FireFox. I have two controls on HTML page: ListBox and TextBox (<selectand <input>). Both controls have event "onchange" and functions for this event (e.g....
5
by: Klaudiusz Bryja | last post by:
Hi, This is for NetCF 2.0. I need to create event handling code which using reflection. I have some parameters in XML which describe how event should be handled. I have code to create...
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...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.