R
RN
In certain situations, I add a datagrid and a button beneath it. All
programmatically added in the "code behind". I add them to a cell with
cell.add(datagrid) and cell.add(button). Take the button for example.
Usually, if the button were there statically, in the ASPX "html" code, I
would simply put some code I want to run in the button's click routine in my
code-behind. But it seems I can't have a button click routine that will
fire because the button is being added programatically and it doesn't
recognize the button as an object when the page comes back on postback.
How am I supposed to have a button click routine? Am I somehow declaring
the button incorrectly so it loses state or is there just no way to have the
button be recognized in the code behind if it was added programmaticaly
before the postback (e.g. when it posts back, even something simple like
button.visible will return an exception that there is no such object)?
programmatically added in the "code behind". I add them to a cell with
cell.add(datagrid) and cell.add(button). Take the button for example.
Usually, if the button were there statically, in the ASPX "html" code, I
would simply put some code I want to run in the button's click routine in my
code-behind. But it seems I can't have a button click routine that will
fire because the button is being added programatically and it doesn't
recognize the button as an object when the page comes back on postback.
How am I supposed to have a button click routine? Am I somehow declaring
the button incorrectly so it loses state or is there just no way to have the
button be recognized in the code behind if it was added programmaticaly
before the postback (e.g. when it posts back, even something simple like
button.visible will return an exception that there is no such object)?