Hi
Into my application there is EditAds.aspx page where the user get a link on his email after he add an Ad into my application. My inquiry is can i bind the cascading ddl to show the value of State column into Ad/product row as well if the user want to update the rest of state will be also reachable. It maybe hard to get what i am looking for excatly so i make a short screen record where it can explain more clearly what i am looking for please have a loot to it.
Please note: rebinding values of Ad/product depending on AdsID which is a query string in the page called: QADNUM
https://www.youtube.com/watch?v=YcJJObe1w50&feature=youtu.be
if (!IsPostBack)
{
if (cookie["Location"] == null)
{
DataTable rEfilterstathpBizDT = new DataTable();
using (SqlConnection REGGfilterstathpBizCon = new SqlConnection(sc))
{
SqlCommand ReggfilterstathpBizCMD = new SqlCommand("SELECT State FROM State WHERE Country = @Location", REGGfilterstathpBizCon);
var Location = cookie.Value;
ReggfilterstathpBizCMD.Parameters.AddWithValue("@Location", Location);
SqlDataAdapter ReghfilterstathpBizAP = new SqlDataAdapter();
ReghfilterstathpBizAP.SelectCommand = ReggfilterstathpBizCMD;
ReghfilterstathpBizAP.Fill(rEfilterstathpBizDT);
Regstatedrdolst.DataSource = rEfilterstathpBizDT;
Regstatedrdolst.DataTextField = "State";
Regstatedrdolst.DataBind();
}
Regstatedrdolst.Items.Insert(0, new ListItem("Select Province", ""));
}
}
protected void Regstatedrdolst_SelectedIndexChanged(object sender, EventArgs e)
{
DataTable RegCityDT = new DataTable();
using (SqlConnection con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["BeravaConnectionString"].ConnectionString))
{
SqlCommand RegCityCom = new SqlCommand("SELECT City FROM Cities WHERE State=@State", con2);
RegCityCom.Parameters.AddWithValue("@State", Regstatedrdolst.SelectedItem.Text);
SqlDataAdapter RegCityADAP = new SqlDataAdapter();
RegCityADAP.SelectCommand = RegCityCom;
RegCityADAP.Fill(RegCityDT);
Regcitiesdrdolst.DataSource = RegCityDT;
Regcitiesdrdolst.DataTextField = "City";
Regcitiesdrdolst.DataBind();
}
Regcitiesdrdolst.Items.Insert(0, new ListItem("Select City", ""));
}