c# - Dynamicaly add buttons to asp table cell without deleting the cells text -


i have asp.table cells contains text , following function add buttons cells

  button btnactiv = new button();                     btnactiv.id = y.tostring();                     btnactiv.text = "dept " + dr_depts["code_dept"].tostring() + "(" + nbr + " )";                     cell.controls.add(btnactiv); 

the buttons added , works fine text of cells gets deleted after add buttons how can add butoons , keep text please ?

first dynamically create table cell , add text , button it:

 tablecell commentcell = new tablecell();  label lblcomment = new label();  lblcomment.text = "text remain in cell."  commentcell.controls.add(lblcomment);  button btnactiv = new button();  btnactiv.id = y.tostring();  btnactiv.text = "dept " + dr_depts["code_dept"].tostring() + "(" + nbr + " )";  commentcell.controls.add(btnactiv); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -