Hi folks,
This is a puzzle for me, I am able to get three DropDownLists to behave like a cascade (it fetches the correct data) but where I run into problem is where I try to set the value for the dropdownlist based on the value of the querystring.
Only the first dropdownlist seems to take it's value from the querystring. The other two does not. In fact the 3rd DropDownlist will also exhibit the error below (it almost looks like the control isn't bound yet:
'ddlStation' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value
FYI, here is the portion that sets the DropDownList in the Page_Load event:
// 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();
}
}
}
Any help is appreciated!