DDL に別の DDL を設定していますが、別のページから値を取得しています
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.DataSource = ProfileMasterDAL.bindcountry();
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, "--Select country--");
}
if(Session["uname"]!=null)
{
DropDownList1.SelectedValue = Session["country"].ToString();
ProfileMasterBLL bll=new ProfileMasterBLL();
foreach (var VARIABLE in ProfileMasterDAL.bindcountry())
{
if (VARIABLE.ToString().Contains(DropDownList1.SelectedItem.Text))
{
var query = (ProfileMasterDAL.GetStatesByCountrys(DropDownList1.SelectedItem.Text));
DropDownList2.DataSource = query;
DropDownList2.DataBind();
}
}
TextBox8.Text = Session["email"].ToString();
string pwd = Session["pwd"].ToString();
TextBox9.Attributes.Add("value",pwd);
TextBox10.Attributes.Add("value", pwd);
}
}
しかし、問題は、DDL 値を変更するたびに、page_load のようにセッション値に固定されるため、DDL で選択した項目に値を変更するにはどうすればよいかということです。