c# - create dynamic controls with div in asp.net -
i want create dynamic div controls inside it. code below.
textbox tb_name = new textbox(); tb_name.id = guid.newguid().tostring(); panel.controls.add(new literalcontrol("<div class='form-group'><div class='clearfix' style='margin-top:15px;'></div><div class='row'><div class='col-md-3'></div><div class='col-md-3'>"+tb_name +"</div></div></div>"));
but displaying system.web.ui.webcontrols.textbox
. how solve it?
you can try this: <input type='text' id='" + guid.newguid().tostring() +"' runat='server'/>
hence complete code looks following:
panel.controls.add(new literalcontrol("<div class='form-group'><div class='clearfix' style='margin-top:15px;'></div><div class='row'><div class='col-md-3'></div><div class='col-md-3'><input type='text' id='" + guid.newguid().tostring() +"' runat='server'/></div></div></div>"));
Comments
Post a Comment