我有一个网页的两个下拉列表(StateNames & CityNames)。 我想绑定CityNames取决于所选的StateName。 我写BindCities()函数来绑定CityNames下拉列表。 通过使用词典我绑定这两个下拉列表。调用用户定义函数从JavaScript
private void BindCity() {
try {
string Action = "BindCity";
int CompanyId = 1;
int StateId = Convert.ToInt32(ddlPresentState.SelectedValue);
Dictionary<int, string> dct = AppBll.BindCityNames(Action, CompanyId, StateId);
ddlPresentCity.DataSource = dct;
ddlPresentCity.DataValueField = "Key";
ddlPresentCity.DataTextField = "Value";
ddlPresentCity.DataBind();
}
catch (Exception) {
throw;
}
}
现在我想从StateNames下拉列表的JavaScript OnChange事件中调用BindCities()函数。 但它不工作。 所以请帮我解决这个问题。 在此先感谢。
显示你的代码.. – Madhu
@AnandDhamane编辑的问题。不要在评论中添加详细信息。 – Ashutosh