如何在后台代码中创建div asp.net C#

来源:百度知道 编辑:UC知道 时间:2024/05/24 03:43:47
如题所示,如何在后台代码中创建div asp.net C#

顶 后台输出就可以 比如
string html="";
html+="<div id=\"myDiv\">后台代码创建div</div>";
Response.write(html);
Response.end();

Response 是专门用来相应客户端Request的
Response.write() 输出的字符 是直接反馈给浏览器的

下面是我用stirngbuilder 对象在asp.net 后台写的table而且还能绑定数据,用它也可以输出div吧
StringBuilder sb = new StringBuilder();
sb.Append(@"<table border='1' cellspacing='0' width='430px' bordercolor='black' ><tr bgcolor='#9CAAC1'align='center'><td width='50px'>编号</td><td width='100px'>全称</td><td width='100px'>类别</td><td width='90px'>拼音码</td><td width='90px'>编码</td></tr>");
this.GridView1.DataSource=supplierbll.SelectSupplierInfoBySpcName(2, pageindex, spname);
this.GridView1.DataBind();
foreach (WebModel.sup