asp.net - create a form in placeholder in C# -
stringbuilder str=new stringbuilder(); str.append("<div style='font-style:oblique;font-size:24px;text-align:left;margin-bottom:25px;'>"); str.append("products"); str.append("</div>"); str.append("<div style='font-style:oblique;font-size:18px;text-align:right;margin-bottom:25px;'>"); str.append("<asp:textbox id='txtsearch' runat='server'></asp:textbox> <asp:button id='btbsearch' runat='server' text='search'/>"); str.append("</div>"); str.append("<table width='100%' border='1' cellpadding='0' cellspacing='0'>");
in sec <div>
, seek create textbox , button , add together them in placeholder. when debug browser console, see them in html code cannot show in browser, show table on browser. there illustration work these cases?
most not generating aspx page render on server, rather sending output of stringbuilder browser. since asp:textbox
, similar asp.net elements can't rendered browser see nil in view (also nodes nowadays don't create html invalid).
you want generate <input...>
elements instead of asp:textbox
see output in browser.
note: there improve way accomplish goal (i.e. client side templates, or regular rendering in view), need spell actual problem first.
c# asp.net
No comments:
Post a Comment