这对我来说是一个谜,我能拿到三个DropDownLists表现得像一个级联(它获取正确的数据),但在那里我遇到的问题是,我尝试设置值基于查询字符串的值的下拉列表。设置的LinqDataSource约束的DropDownList使用URL查询字符串
只有第一个下拉列表,似乎把它从查询字符串值。另外两个没有。事实上第三DROPDOWNLIST也将表现出以下(这看起来很像控制误差尚未绑定:
'ddlStation' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
仅供参考,这里是设置DropDownList的Page_Load事件中的部分:
// see if there is any querystring and set dropdownlist accordingly
if (Request.QueryString["cell"] != null)
{
ddlCell.SelectedValue = Request.QueryString["cell"].ToString();
if (Request.QueryString["subcell"] != null)
{
ddlSubCell.SelectedValue = Request.QueryString["subcell"].ToString();
if (Request.QueryString["station"] != null)
{
ddlStation.SelectedValue = Request.QueryString["station"].ToString();
}
}
}
任何帮助表示赞赏!
应该将此置于对leppie的回答评论 – user7116 2008-12-01 14:25:20