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

OnClick Handler for Buttons added During Page_PreRender? How?

Hello:
I am designing a WebControl that swaps between a DayView, WeekView, or Month Schedule.
What I have done this time is to use CreateChildControls() to make a Pulldown that offers the view
type
but leave rendering of the actual calendar to PreRender(), where it reads the value of the DropDown
to decide what type of Table/TableRow/TableCells algorythm
to use (DayView = one column x many rows, WeekView, two columns, 4rows, etc...)

Wiring up an EventHandler for the Select/Dropdown was easy since it existed and was added to the
control hierarchy before Page_Load finished.

But I can't figure out how to catch clicks on the Cells, since they are generated after Page_Load,
and any buttons that I put in them, and attach EventHandlers to, are never called...

I can't make them before, because there are so many cells -- I don't think I should add a week view,
day view, month view to the control just to wire up an events to them, and then discard the layouts
I am not using. Would be insane and super slow/heavy.

I think that the idea would be IPostBackDataHandler -- but I am not sure how to wire it up.

If anybody has some experience with this -- man, that would really make my day. It seems that most
of the controls I want to do are being held up by this concept: making it so that rendering can
change shape -- yet be able to catch events from TextBox and buttons within the output.

Thanks so much!
Sky
Nov 18 '05 #1
0 849

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

Similar topics

2
by: mike piano | last post by:
With html buttons, I can say onclick="MyFunction();" and it calls a JavaScript function called "MyFunction", but with the Web Controls buttons, OnClick="MyFunction();" produces an error: ...
8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
2
by: Peter | last post by:
I would like to use code like the following: this.onclick = function(e) { alert("I'm in the onclick handler"); } But I do not want to wipe out any existing onclick event code. I want to do...
1
by: Ron | last post by:
I have created a 'LoginDialog ' user control with 'OK' and 'Cancel' buttons. Then I have included the control into a Web Form. <form id="Login" method="post" runat="server" onclick=""> <div...
2
by: Richard Morse | last post by:
Hi! I have an aspx that I've created which has an asp:Button in it. I would like to be able to change the OnClick handler at runtime (basically, I want this form to either edit or create a...
5
by: Russell Smallwood | last post by:
Hello all, Why can't I wire up an event during the "Raise PostBackEvent" stage of a postback? Just in case this is the wrong question, the situation: deep in the bowls of some code-behind...
3
by: wardy1975 | last post by:
Hi all....looking for a bit of help here....I'm using an asp.net server side button, and trying to add an onclick event on the button to call a javascript function. However, I am trying to enter...
9
by: Donius | last post by:
Hey everyone, i am doing some stuff where i'd like to pop up a little confirmation before a user clicks on a 'delete' link. Just trying to keep the markup clean, i added an attribute ...
0
by: none | last post by:
Hi, I’ve got a problem with my onclick handlers for command buttons being dropped on page render for a popup window. On the opening window, I have several command buttons, and they all have...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.