asp.net 里怎么把respone.write输出的层放在 div里面 我这样 该怎么写了???大哥大姐 就这么点分在线等 20
for(inti=0;i<conn.read("div32").Rows.Count;i++){Response.Write("<tablestyle='width:40...
for (int i = 0;i<conn.read("div32").Rows.Count;i++)
{
Response.Write("<table style='width:400px;font-size:small;'>");
Response.Write("<tr>");
Response.Write("<td width='250'><a href='" + conn.read("div32").Rows[i]["uurl"] + "'target='_blank''+'>" + conn.read("div32").Rows[i]["h4"] + "</a></td>");
Response.Write("</tr>");
Response.Write("</table>");
}
this.div3.innerHtml="" 这儿该怎么把table 放在div3里面 怎么写?? 展开
{
Response.Write("<table style='width:400px;font-size:small;'>");
Response.Write("<tr>");
Response.Write("<td width='250'><a href='" + conn.read("div32").Rows[i]["uurl"] + "'target='_blank''+'>" + conn.read("div32").Rows[i]["h4"] + "</a></td>");
Response.Write("</tr>");
Response.Write("</table>");
}
this.div3.innerHtml="" 这儿该怎么把table 放在div3里面 怎么写?? 展开
2个回答
展开全部
你用一个string 变量装住撒。
string text = "";
for (int i = 0;i<conn.read("div32").Rows.Count;i++)
{
text += "<table style='width:400px;font-size:small;'>";
text += "<tr>";
text += "<td width='250'><a href='" + conn.read("div32").Rows[i]["uurl"] + "'target='_blank''+'>" + conn.read("div32").Rows[i]["h4"] + "</a></td>";
text += "</tr>";
text +="</table>";
}
this.div3.innerHtml=text;
明白了没?
string text = "";
for (int i = 0;i<conn.read("div32").Rows.Count;i++)
{
text += "<table style='width:400px;font-size:small;'>";
text += "<tr>";
text += "<td width='250'><a href='" + conn.read("div32").Rows[i]["uurl"] + "'target='_blank''+'>" + conn.read("div32").Rows[i]["h4"] + "</a></td>";
text += "</tr>";
text +="</table>";
}
this.div3.innerHtml=text;
明白了没?
展开全部
//代码部分
stringbuilder div3Text=new stringbuilder();
for (int i = 0;i<conn.read("div32").Rows.Count;i++)
{
div3Text.Append("<table style='width:400px;font-size:small;'>");
div3Text.Append("<tr>");
div3Text.Append("<td width='250'><a href='" + conn.read("div32").Rows[i]["uurl"] + "'target='_blank''+'>" + conn.read("div32").Rows[i]["h4"] + "</a></td>");
div3Text.Append("</tr>");
div3Text.Append("</table>");
}
lblDiv3Text.Text=div3Text.ToString();
//.aspx页面
<div>
<asp:Literal ID="lblDiv2Text" runat="server" />
</div>
这样应该可以吧?
stringbuilder div3Text=new stringbuilder();
for (int i = 0;i<conn.read("div32").Rows.Count;i++)
{
div3Text.Append("<table style='width:400px;font-size:small;'>");
div3Text.Append("<tr>");
div3Text.Append("<td width='250'><a href='" + conn.read("div32").Rows[i]["uurl"] + "'target='_blank''+'>" + conn.read("div32").Rows[i]["h4"] + "</a></td>");
div3Text.Append("</tr>");
div3Text.Append("</table>");
}
lblDiv3Text.Text=div3Text.ToString();
//.aspx页面
<div>
<asp:Literal ID="lblDiv2Text" runat="server" />
</div>
这样应该可以吧?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询