Click here to Skip to main content
15,917,731 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError table 0 cant be found Pin
suriee30-Jan-07 9:02
suriee30-Jan-07 9:02 
AnswerRe: Error table 0 cant be found Pin
Christian Graus30-Jan-07 9:24
protectorChristian Graus30-Jan-07 9:24 
GeneralRe: Error table 0 cant be found Pin
suriee30-Jan-07 9:28
suriee30-Jan-07 9:28 
AnswerRe: Error table 0 cant be found Pin
ednrgc31-Jan-07 6:57
ednrgc31-Jan-07 6:57 
QuestionReport Cant change the Information Pin
Sarfaraj Ahmed30-Jan-07 7:11
Sarfaraj Ahmed30-Jan-07 7:11 
QuestionWeb page as DataSource Pin
aransiola30-Jan-07 6:20
aransiola30-Jan-07 6:20 
AnswerRe: Web page as DataSource Pin
Guffa30-Jan-07 8:56
Guffa30-Jan-07 8:56 
QuestionHow I call the event handler ? Pin
MaximilianDC30-Jan-07 6:14
MaximilianDC30-Jan-07 6:14 
Hi.

I'm a new member here.
My English is not very well, but I hope it´s good enough to make you understand me.
Well...
I'm with a litlle problems here.
I registered a "Click" event
handler for the dynamicly added control. However, when I
click the control , its event handler isn't called. But If I add and register the event handler operation in the Page_load, it works well.

Here is the code:

protected void CreateTable()
{
HtmlTable tablegen = new HtmlTable();
HtmlTableRow rowgen = new HtmlTableRow();

for (int i = 0; i <= 2; i++)
{
HtmlTableCell cellgen = new HtmlTableCell();
if (i == 0)
{
cellgen.Width = "50px";
cellgen.Align = "center";
cellgen.InnerText = "......"
}
else if(i == 1)
{
cellgen.Width = "50px";
cellgen.Align = "center";
cellgen.InnerText = ".....";
}
else if(i == 2)
{
cellgen.Width = "50px";
cellgen.Align = "center";
ImageButton imgButton = new ImageButton();
imgButton.ImageUrl = "Test.gif";
imgButton.ToolTip = "Test";
imgButton.Click +=
new ImageClickEventHandler(imgButton_Click);
cellgen.Controls.Add(imgButton);
}
rowgen.Cells.Add(cellgen);

}
tablegen.Rows.Add(rowgen);

I call this method from a click event of a button.
I need to create controls, in this case ImageButtons, that are
dynamically loaded, and they must be allocated in the third cell of a table in every row. The curios is that they don't call the event handler when created out of the Page_Load.

Somebody can help me ?

Maximilian Thanks

AnswerRe: How I call the event handler ? Pin
Christian Graus30-Jan-07 9:25
protectorChristian Graus30-Jan-07 9:25 
AnswerRe: How I call the event handler ? Pin
ToddHileHoffer30-Jan-07 9:41
ToddHileHoffer30-Jan-07 9:41 
QuestionMulti lines of text in a Gridview Pin
dptalt30-Jan-07 6:02
dptalt30-Jan-07 6:02 
AnswerRe: Multi lines of text in a Gridview Pin
Christian Graus30-Jan-07 9:31
protectorChristian Graus30-Jan-07 9:31 
GeneralRe: Multi lines of text in a Gridview Pin
dptalt31-Jan-07 10:12
dptalt31-Jan-07 10:12 
AnswerRe: Multi lines of text in a Gridview Pin
ToddHileHoffer30-Jan-07 9:37
ToddHileHoffer30-Jan-07 9:37 
GeneralRe: Multi lines of text in a Gridview Pin
dptalt31-Jan-07 10:13
dptalt31-Jan-07 10:13 
QuestionReport HyperLink Pin
Sarfaraj Ahmed30-Jan-07 5:58
Sarfaraj Ahmed30-Jan-07 5:58 
AnswerRe: Using Checkbox in Gridview Pin
ToddHileHoffer30-Jan-07 9:44
ToddHileHoffer30-Jan-07 9:44 
QuestionHTML tags in csharp Pin
SpiderR30-Jan-07 4:51
SpiderR30-Jan-07 4:51 
AnswerRe: HTML tags in csharp Pin
Jasmine250130-Jan-07 5:56
Jasmine250130-Jan-07 5:56 
QuestionRe: HTML tags in csharp Pin
SpiderR30-Jan-07 18:44
SpiderR30-Jan-07 18:44 
AnswerRe: HTML tags in csharp Pin
Jasmine250131-Jan-07 5:16
Jasmine250131-Jan-07 5:16 
QuestionRe: HTML tags in csharp Pin
SpiderR31-Jan-07 18:05
SpiderR31-Jan-07 18:05 
QuestionAutoComplete problem Pin
MohammadYousef30-Jan-07 3:54
MohammadYousef30-Jan-07 3:54 
QuestionAppoinment Schedule Pin
stevelizardi30-Jan-07 3:48
stevelizardi30-Jan-07 3:48 
AnswerRe: Appoinment Schedule Pin
Christian Graus30-Jan-07 9:26
protectorChristian Graus30-Jan-07 9:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.