private void FillStatusDropDown() { LoginInfo regInfo = (LoginInfo)Session["loginInfo"]; StatusDropDownList.Items.Add(new ListItem(MessageStatus.Active.ToString(), Convert.ToInt32(MessageStatus.Active).ToString())); StatusDropDownList.Items.Add(new ListItem(MessageStatus.InActive.ToString(), Convert.ToInt32(MessageStatus.InActive).ToString())); StatusDropDownList.DataBind(); }
protected void RenderStatusDropDownList() { TaskStatus statusMapping = TaskStatus.NotStarted; if (this.task != null && TaskUtilities.IsValidTaskStatus(this.task.Status)) { statusMapping = this.task.Status; } StatusDropDownList statusDropDownList = new StatusDropDownList("divStatus", statusMapping); statusDropDownList.Render(base.Response.Output); }
protected void Page_Load(object sender, EventArgs e) { ErrorMessageLabel.Visible = false; if (!IsPostBack) { // Populate data into dropdown lists. try { CommonService.CommonService commonService = serviceLoader.GetCommon(); // Agents. AgentDropDownList.DataSource = commonService.GetAgentsList(); AgentDropDownList.DataValueField = "UserId"; AgentDropDownList.DataTextField = "UserName"; AgentDropDownList.DataBind(); AgentDropDownList.Items.Insert(0, new ListItem("<All Agents>", "0")); // Categories. CategoryDropDownList.DataSource = commonService.GetLookups("Design Category"); CategoryDropDownList.DataValueField = "LookupId"; CategoryDropDownList.DataTextField = "Name"; CategoryDropDownList.DataBind(); CategoryDropDownList.Items[0].Text = "<All Categories>"; // Statuses. StatusDropDownList.DataSource = commonService.GetLookups("Design Status"); StatusDropDownList.DataValueField = "LookupId"; StatusDropDownList.DataTextField = "Name"; StatusDropDownList.DataBind(); StatusDropDownList.Items[0].Text = "<All Statuses>"; } catch (Exception ex) { ErrorMessageLabel.Text = "Unable to process the request. Please contact your administrator."; ErrorMessageLabel.Visible = true; log.Error("Unknown Error", ex); } } }
private void FillStatusDropDown() { StatusDropDownList.Items.Add(new ListItem(MessageStatus.Active.ToString(), Convert.ToInt32(MessageStatus.Active).ToString())); StatusDropDownList.Items.Add(new ListItem(MessageStatus.InActive.ToString(), Convert.ToInt32(MessageStatus.InActive).ToString())); StatusDropDownList.DataBind(); }