protected void Page_Load(object sender, EventArgs e) { PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); gvEmailSchedule.PageSize = PageSize; if (!IsPostBack) { CompanyDAL newCompanyDal = new CompanyDAL(); IList <Company> companies = newCompanyDal.GetAllCompany(); foreach (Company company in companies) { ListItem item = new ListItem(); item.Text = company.CompanyName.Substring(0, company.CompanyName.Length > 45?45:company.CompanyName.Length); item.Value = company.CompanyRegID.ToString(); ddlSearchCompany.Items.Add(item); } TAFDAL newTAF = new TAFDAL(); IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates(); foreach (TAFTemplate template in templates) { ListItem item = new ListItem(); item.Text = template.TemplateName; item.Value = template.TemplateID.ToString(); ddlSearchTemplate.Items.Add(item); } } }
protected void Page_Load(object sender, EventArgs e) { lblError.Text = string.Empty; lblMsg.Text = string.Empty; if (!IsPostBack) { CompanyDAL newCompanyDal = new CompanyDAL(); IList <Company> companies = newCompanyDal.GetAllCompany(); foreach (Company company in companies) { ListItem item = new ListItem(); item.Text = company.CompanyName; item.Value = company.CompanyRegID.ToString(); ddlCompany.Items.Add(item); } TAFDAL newTAF = new TAFDAL(); IList <TAFTemplate> templates = newTAF.GetAllTAFTemplates(); foreach (TAFTemplate template in templates) { ListItem item = new ListItem(); item.Text = template.TemplateName; item.Value = template.TemplateID.ToString(); ddlSelectTemplate.Items.Add(item); } } }