我创建了动态超链接并从数据库中获取数据。现在我需要将这些数据放在特定的 div 标签中。请帮我。
<div runat="server" id="bdy">
</div>
Code Behind
protected void Page_Load(object sender, EventArgs e)
{
MySqlCommand inscmd = new MySqlCommand("select * from category", con);
MySqlDataAdapter a = new MySqlDataAdapter(inscmd);
DataTable t = new DataTable();
foreach (DataRow row in t.Rows)
{
bdy.InnerHtml.Equals("<a href=\"category.aspx?refid=" + row["cid"] + "\">" + row["catname"] + "</a><br />");
// bdy is div name
Response.Write("<a href=\"category.aspx?refid="+row["cid"]+"\">"+row["catname"]+"</a><br />");
}
}