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

Event handler never called.

The code below works, except the lButton_Click event handler is never called
when any of the ImageButtons are clicked. I've done this loads of times in
2003, what am I doing wrong in 2005?
ImageMaker.aspx is just a WebForm that BinaryWrites the applicable Image as a
byte[].

Expand|Select|Wrap|Line Numbers
  1. protected void Page_Load(object sender, EventArgs e)
  2. {
  3. this.getThumbnails();
  4. }
  5.  
  6. private void getThumbnails()
  7. {
  8. System.Web.UI.WebControls.ImageButton lButton;
  9. foreach (string lFile in Directory.GetFiles(@"C:\Graphics\Ethan"))
  10. {
  11. lButton = new System.Web.UI.WebControls.ImageButton();
  12. lButton.ID = lFile;
  13. lButton.ImageUrl = "ImageMaker.aspx?ImageAddress=" + lButton.ID;
  14. lButton.Click +=new ImageClickEventHandler(this.lButton_Click);
  15. this.pnlThumbnails.Controls.Add(lButton);
  16. }
  17. }
  18.  
  19. private void lButton_Click(object sender, ImageClickEventArgs e)
  20. {
  21. ImageButton lButton = sender as ImageButton;
  22. this.imgMain.ImageUrl = "ImageMaker.aspx?ImageAddress=" + lButton.ID +
  23. "&ImageType=full";
  24. th
  25.  
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200608/1

Aug 20 '06 #1
1 877
Any ideas?

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

Aug 21 '06 #2

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

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
3
by: Kent | last post by:
The following is a greatly simplified example of what I would like to accomplish using the event/delegate features of .NET I have a class "NumGen" that produces a random set of numbers between 0...
2
by: Breeto | last post by:
Can anyone please tell me why the following doesn't work... using System; using System.Web; namespace AspTests {
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
4
by: eggie5 | last post by:
I have this even handler (using prototype.js): showCommentsLinks.observe('click', function(event) { alert('hi') }); It's attaching to a link element: <a id="showCommentsLink"...
3
by: =?Utf-8?B?RWR3aW4=?= | last post by:
Hello Everyone. Below is the code that is in question. --- BEGIN CODE WITHIN INHERITED FORM --- protected virtual void OnFormClosing(object sender, FormClosingEventArgs e) { switch...
4
by: tshad | last post by:
I am just getting started with events and had a couple of questions on why they do what they do. If you have a textbox and you want to handle an event you can just do: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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...
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,...

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.