Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 145435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:25:23+00:00 2026-05-11T08:25:23+00:00

I have a dynamically created table and in some of the cells i have

  • 0

I have a dynamically created table and in some of the cells i have an image button associated with the redBall_Click() handler

(here is the code behind)

    TableCell cellOK = new TableCell();     cellOK.Style.Add(HtmlTextWriterStyle.TextAlign, 'Center');     cellOK.Width = new Unit('3%');     ImageButton redBall = new ImageButton();     redBall.CausesValidation = false;     redBall.ID = id;     redBall.ImageUrl = '~/App_Themes/DotRed.png';      redBall.Click += new ImageClickEventHandler(redBall_Click);     cellOK.Controls.Add(redBall); 

My problem is that the redBall_Click() method is never called (neither after the PostBack)

How can i solve this?

P.S. : I can’t use a static link because every ImageButton is associated with a specific ID that i must pass to the page i call (for example as a Session object)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:25:23+00:00Added an answer on May 11, 2026 at 8:25 am

    I finally resolved (just yesterday).

    I guess I was building my buttons too late: in the Page_PreRender (after the event was to be fired) maybe if i put the creation in Page_Load (yes, I create everything also on PostBack) it would handle the click, but I think I won’t try since I found a workaround.

    I’ll explain for anyone who could have the same problem:

    private TableCell cellOK(string id) {     TableCell cellOK = new TableCell();     cellOK.Style.Add(HtmlTextWriterStyle.TextAlign, 'Center');     Image redBall = new Image();     redBall.ID = id; // useless     redBall.ImageUrl = 'redball.gif';     HyperLink hl = new HyperLink();     hl.Controls.Add(redBall);     hl.NavigateUrl = MyPage + '?id=' + id;     cellOK.Controls.Add(hl);     return cellOK; } 

    and in Page_Init()

    string m_QueryStringId = Request.QueryString.Get('id'); if (!string.IsNullOrEmpty(m_QueryStringId)) {     // Do something } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that is dynamically created in some c# code-behind when a
i have a table which contains a bunch of dynamically created radio button lists,
I have some code dynamically created by Sigma, which looks like this: <div id=myGrid1_headDiv
I have a dynamically created table which in the last <td> there is a
I have a table which is dynamically created based on the amount of results
I have two columns in my table and the rows are created dynamically. <table
I have dynamically created some list of RadioButtons with some values. pro grammatically I
I have dynamically created WrapPanel (_wp) with several Borders. And I need create handler
I have some dynamically created rows/columns. What I'd like to do is set a
I have a table row that is dynamically created, so I have no control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.