你这个语句不会出错吗?
飘过~~
这样也是内容显示了两遍 为什么呢?版主一定要帮帮我啊
protected void articleType_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(this.articleType.selectedIndex!=0)
{
SqlConnection conn1 = new SqlConnection(ConfigurationSettings.AppSettings["connstring"]);
conn1.Open();
string articleTypeId = this.articleType.SelectedValue;
SqlDataAdapter articleCmd1 = new SqlDataAdapter("select * from Article where Article_Type="+articleTypeId,conn1);
DataSet ds = new DataSet();
articleCmd1.Fill(ds,"Article");
foreach(DataRow Article in ds.Tables[ "Article" ].Rows)
{
TableRow articleR = new TableRow();
TableCell articleC = new TableCell();
articleC.Controls.Add(new LiteralControl(Article["Article_Title"]+"<br>"+Article["Article_Content"]));
articleR.Cells.Add(articleC);
TableCell articleC2 = new TableCell();
articleC2.Controls.Add(new LiteralControl("<input type='radio' value='"+Article["Article_Id"]+"'> "));
articleR.Cells.Add(articleC2);
articleTable.Rows.Add(articleR);
}
}
}
在你这段代码加一个判