Hello there,
I have the scenerio where the content page is influenced from dropdownlists on the masterpage.
One of the ddl's becomes its data through code behind, like so
Code:
ddlType.DataSource = accTypeInTown;
ddlType.Items.Add("select type");
ddlType.DataTextField = "Name";
ddlType.DataValueField = "Id";
ddlType.DataBind();
this databinding takes places in the SelectedIndexChanged of another ddl, to filter its values.
To access these ddls on a content page, I created public properties for them in the masterpage.cs, like so
Code:
public DropDownList MPddlTown
{
get
{
return ddlTown;
}
set
{
ddlTown = value;
}
}
public DropDownList MPddlType
{
get
{
return ddlType;
}
set
{
ddlType = value;
}
However if I now try to load the page in the browser, I get the following error:
Input string was not in a correct format.
pointing to the code-line ddlType.DataBind();
How can this be, before declaring the public ddl properties it worked fine...?
Does anybody have any suggestions?
Thanks in advance, Robin