{
if (controls is System.Web.UI.WebControls.DropDownList )
{
System.Web.UI.WebControls.DropDownList c = (DropDownList)controls;
c.Items.Add(new ListItem("所有","所有"));
}
}
foreach (Control controls in Page.Form.Controls){
if (controls.GetType()=="System.Web.UI.WebControls.DropDownList" )
{
System.Web.UI.WebControls.DropDownList c = (DropDownList)controls;
c.Items.Add(new ListItem("所有","所有"));
}
}
foreach (Control controls in Page.Form.Controls)
{
if (controls.GetType()== typeof(System.Web.UI.WebControls.DropDownList))
{
System.Web.UI.WebControls.DropDownList c = (DropDownList)controls;
c.Items.Add(new ListItem("所有","所有"));
}
}
foreach (Control controls in Page.Form.Controls)
{
if (controls.GetType().Equals(typeof(System.Web.UI.WebControls.DropDownList)))
{
System.Web.UI.WebControls.DropDownList c = (DropDownList)controls;
c.Items.Add(new ListItem("所有","所有"));
}
}