H
Henke
Hello,
I have one ImageButton controls which I initialize in
Page_Load and declare on class level.
ImageButton save = new ImageButton();
save.ImageUrl = "save.gif"
save.Click += new ImageClickEventHandler(this.save_click);
This ImageButton is added to a dynamic table which is also
in initialized in Page_Load
if(!PostBack)
{
createTableHead(); //The head of the table
createTableEdit() //The body of the table
Session["table"] = tblGeneric // This is saved in session and is
read from the session in OnInit. All dynamic controls needs to be re-
// initialized
}
function void createTableHead()
{
tblGeneric = new Table() // Declared at class level
TableRow row = new TableRow()
TableCell cell = new TableCell()
cell.Controls.add(save);
row.Cells.Add(cell)
tblGeneric.Rows.Add(row)
// more code below, but only new rows and cells.
}
I have one Label which contain error messages during the save method.
The event method which is connceted to the ImageButton click event fires
correctly, but when I want to change the
Text property on the Label object then the change is not reflected on the
web page. If I debug
the event method I can verify that the Text property has changed, but the
text on the web page is not updated.
If I drop a new ImageButton on the web page and let VS.IDE make a
save_click() method, then the
Label Text property is updated and the change is visible on the web page.
What I find strange is that the event handler method fires correctly and I
can access the tabels rows and cells and
the controls in the cells aswell, but I can not update the text on the web
page.
Do I have to declare and initialize the ImageButton in another Page method
or what is going on ?
Regards,
// Henrik
I have one ImageButton controls which I initialize in
Page_Load and declare on class level.
ImageButton save = new ImageButton();
save.ImageUrl = "save.gif"
save.Click += new ImageClickEventHandler(this.save_click);
This ImageButton is added to a dynamic table which is also
in initialized in Page_Load
if(!PostBack)
{
createTableHead(); //The head of the table
createTableEdit() //The body of the table
Session["table"] = tblGeneric // This is saved in session and is
read from the session in OnInit. All dynamic controls needs to be re-
// initialized
}
function void createTableHead()
{
tblGeneric = new Table() // Declared at class level
TableRow row = new TableRow()
TableCell cell = new TableCell()
cell.Controls.add(save);
row.Cells.Add(cell)
tblGeneric.Rows.Add(row)
// more code below, but only new rows and cells.
}
I have one Label which contain error messages during the save method.
The event method which is connceted to the ImageButton click event fires
correctly, but when I want to change the
Text property on the Label object then the change is not reflected on the
web page. If I debug
the event method I can verify that the Text property has changed, but the
text on the web page is not updated.
If I drop a new ImageButton on the web page and let VS.IDE make a
save_click() method, then the
Label Text property is updated and the change is visible on the web page.
What I find strange is that the event handler method fires correctly and I
can access the tabels rows and cells and
the controls in the cells aswell, but I can not update the text on the web
page.
Do I have to declare and initialize the ImageButton in another Page method
or what is going on ?
Regards,
// Henrik