B
Bobby Ryzhy
(Type your message here)
--------------------------------
From: nitin n
i m making one function to fill dropdownlist.
For tht i want to pass dropdownlist control to one function.
wht would be the best solution for it?
Give this a go.
private void FilDropDown(System.Web.UI.WebControls.DropDownList dropDownList)
{
try
{
DataSet packageTypes = PackageTypes.GetTypes();
foreach (DataRow row in packageTypes.Tables[0].Rows)
{
ListItem Li = new ListItem(row[1].ToString(), row[0].ToString());
dropDownList.Items.Add(Li);
}
}
catch(Exception ex)
{
friendlyError.WriteError(ex);
}
}
Bobby Ryzhy
bobby @ domain below
http://weekendtech.net