我DDL這在選擇改變了它執行一些代碼 但是當我試圖這樣做,這是不行之有效,當我檢查,我發現DDL中選擇值的原因= 0我也做得很好,這是我的代碼下拉列表中有零值
protected void DDlProductFamily_SelectedIndexChanged(object sender, EventArgs e)
{
if (DDlProductFamily.DataValueField.Contains("ProductCategory_Id"))
using (SqlConnection Con = Connection.GetConnection())
{
SqlCommand Com = new SqlCommand("GetListViewByProductCategory", Con);
Com.CommandType = CommandType.StoredProcedure;
Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", DDlProductFamily.SelectedValue.ToString()));
SqlDataAdapter DA = new SqlDataAdapter(Com);
DA.Fill(dt);
DataList1.DataSource = dt;
DataList1.DataBind();
}
}
你有問題嗎?您沒有提出任何問題或提出任何問題。 – Oded 2010-04-20 09:20:53
問題是DDL有沒有價值,沒有在這裏執行代碼 – Myworld 2010-04-20 11:52:07