dropdownlist确定传选中的值问题.在线等.急
我现在用dropdownlist做了一个三级联动,我想用三级联动选出来的ID用post的方法(就是as.asp?id=19的方法)传到另一个页面.(我的意思是: 品牌(下拉) 系列(下拉) 具体某一个产品(下拉) 确定按钮 当我按下确定时,就能把我选好的产品ID值传来我指定的页面.怎么实现)
cs源码
if(!IsPostBack)
{
ddlCategoryBind();
ddlCategory1Bind();
ddlCategory2Bind();
ddlCategory3Bind();
}
}
private void ddlCategoryBind()
{
Db.Category myCategory = new Db.Category();
DataSet ds = myCategory.dsCategoryDeepID4( "4 ");
for(int i=0;i <ds.Tables[0].Rows.Count;i++)
{
if(ds.Tables[0].Rows[i][2].ToString()== "001 ")
{
ds.Tables[0].Rows[i][3] = ds.Tables[0].Rows[i][3].ToString();
}
else
{
for(int j=1;j <int.Parse(ds.Tables[0].Rows[i][2].ToString());j++)
{
ds.Tables[0].Rows[i][3] = "|__ " + ds.Tables[0].Rows[i][3].ToString();
}
}
}
ddlCategory.DataSource = ds.Tables[0].DefaultView;
ddlCategory.DataTextField = "Category ";
ddlCategory.DataValueField = "OrderID ";
ddlCategory.DataBind();
}
private void ddlCategory1Bind()
{
Db.Category myCategory = new Db.Category();
DataSet ds = myCategory.dsCategoryFatherID4(ddlCategory.SelectedValue);
ddlCategory1.DataSource = ds.Tables[0].DefaultView;
ddlCategory1.DataTextField = "Category ";
ddlCategory1.DataValueField = "OrderID ";
ddlCategory1.DataBind();
Label4.Text=ddlCategory.SelectedValue;
}
private void ddlCategory2Bind()
{
Db.Category myCategory = new Db.Category();
Label1.Text = ddlCategory1.SelectedValue;
DataSet ds = myCategory.dsCategoryFatherID41(ddlCategory1.SelectedValue);
ddlCategory2.DataSource = ds.Tables[0].DefaultView;
ddlCategory2.DataTextField = "proname ";
ddlCategory2.DataValueField = "id ";
ddlCategory2.DataBind();
Label2.Text = ddlCategory2.SelectedValue;
}
private void ddlCategory3Bind()
{
Db.Category myCategory = new Db.Category();
Label1.Text = ddlCategory2.SelectedValue;
DataSet ds = myCategory.dsCategoryFatherID41(ddlCategory2.SelectedValue);
ddlCategory3.DataSource = ds.Tables[0].DefaultView;
ddlCategory3.DataTextField = "proname ";
ddlCategory3.DataValueField = "id ";
ddlCategory3.DataBind();
// Label2.Text = ddlCategory2.SelectedValue;
}
private void ddlCategory_SelectedIndexChanged(object sender, System.EventArgs e)
{
ddlCategory1Bind();
}
private void ddlCategory1_SelectedIndexChanged(object sender, System.EventArgs e)
{
ddlCategory2Bind();
}
private void ddlCategory2_SelectedIndexChanged(object sender