protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e) { if (RadioButton1.Checked) { com.CommandText = "select distinct st_fname+' '+st_lname as fullname ,sa.st_id from student s , [st-Act] sa where s.st_id = sa.st_id and Act_id =" + DropDownList4.SelectedValue; com.Connection = con; con.Open(); SqlDataReader dr1 = com.ExecuteReader(); CheckBoxList1.DataSource = dr1; CheckBoxList1.DataTextField = ("fullname"); CheckBoxList1.DataValueField = ("st_id"); CheckBoxList1.DataBind(); con.Close(); } else if (RadioButton2.Checked) { com.CommandText = "select distinct st_fname+' '+st_lname as fullname ,sa.st_id from student s , [st-Act] sa where s.st_id = sa.st_id and s.Dept_id =" + DropDownList3.SelectedValue + " and Act_id =" + DropDownList4.SelectedValue; com.Connection = con; con.Open(); SqlDataReader dr2 = com.ExecuteReader(); // DropDownList4.DataSource = dr2; CheckBoxList1.DataSource = dr2; CheckBoxList1.DataTextField = ("fullname"); CheckBoxList1.DataValueField = ("st_id"); CheckBoxList1.DataBind(); con.Close(); } }
/// <summary> /// 页面加载 /// </summary> protected void Page_Load(object sender, EventArgs e) { base.moduleID = 103; if (!IsPostBack) { AuthUserOperationPermission(Permission.Add); IList <GameKindItem> list = FacadeManage.aidePlatformFacade.GetGameList(); if (list != null && list.Count > 0) { //ddlKind.DataSource = list; //ddlKind.DataTextField = "KindName"; //ddlKind.DataValueField = "KindID"; //ddlKind.DataBind(); CheckBoxList1.DataSource = list; CheckBoxList1.DataTextField = "KindName"; CheckBoxList1.DataValueField = "KindID"; CheckBoxList1.DataBind(); } if (TypeID <= 0) { GID.Visible = false; GNAME.Visible = false; } else { GID.Visible = true; GNAME.Visible = true; } } }
private void CheckBoxListItems() { rootCfg = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/petroneeds"); connection = rootCfg.ConnectionStrings.ConnectionStrings["petroneedsConnectionString2"].ConnectionString.ToString(); con = new SqlConnection(connection); con.ConnectionString = connection; con.Open(); dataset = new DataSet(); comm = new SqlCommand("SELECT MenuName, MenuID, ParentID FROM tbl_WebMenu", con); adapter = new SqlDataAdapter(comm); adapter.Fill(dataset); CheckBoxList1.DataSource = dataset; CheckBoxList1.DataTextField = "MenuName"; CheckBoxList1.DataValueField = "MenuID"; //CheckBoxList1.Items[].FindByValue(0) = "ParentID"; ////CheckBoxList1.SelectedIndex.CompareTo("ParentID"); CheckBoxList1.DataBind(); if (CheckBoxList1.DataValueField.Length == 1) { for (int i = 0; i < CheckBoxList1.Items.Count; i++) { CheckBoxList1.Items[i].Selected = true; } } }
protected void EventDateDDL_SelectedIndexChanged(object sender, EventArgs e) { //Selection for event date when displaying activities Console.WriteLine(EventDateDDL.SelectedValue); String sqlQuery = "Select EventID, EventName, EventName + ' ' + convert(nvarchar, convert(nvarchar, Time, 0)) as EventNameTime, Date from Event where Date = '" + EventDateDDL.SelectedValue + "'"; //Get connection string from web.config file string strcon = ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString; //create new sqlconnection and connection to database by using connection string from web.config file SqlConnection con = new SqlConnection(strcon); con.Open(); DataTable dtx = new DataTable(); SqlDataAdapter sqlAdapter = new SqlDataAdapter(sqlQuery, con); sqlAdapter.Fill(dtx); if (dtx.Rows.Count > 0) { CheckBoxList1.DataSource = dtx; CheckBoxList1.DataTextField = "EventNameTime"; CheckBoxList1.DataValueField = "EventID"; CheckBoxList1.DataBind(); } CheckBoxListSelect(); con.Close(); }
private void LoadPlantName() { try { dtm = DateTime.ParseExact(txt_FromDate.Text, "dd/MM/yyyy", null); dtm1 = DateTime.ParseExact(txt_ToDate.Text, "dd/MM/yyyy", null); string d1 = dtm.ToString("MM/dd/yyyy"); string d2 = dtm1.ToString("MM/dd/yyyy"); ds = null; ds = BllPlant.LoadPlantNameChkLst1(ccode.ToString()); if (ds != null) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "Plant_Name"; CheckBoxList1.DataValueField = "plant_Code";//ROUTE_ID CheckBoxList1.DataBind(); } else { } } catch (Exception ex) { } }
protected void Page_Load(object sender, System.EventArgs e) { string s = Request.Params["UserID"]; userID = int.Parse(Request.Params["UserID"]); currentUser = new User(userID); Label1.Text = "用户: " + currentUser.UserName + " 角色分配"; if (!Page.IsPostBack) { DataSet dsRole = AccountsTool.GetRoleList(); CheckBoxList1.DataSource = dsRole.Tables[0].DefaultView; CheckBoxList1.DataTextField = "Description"; CheckBoxList1.DataValueField = "RoleID"; CheckBoxList1.DataBind(); AccountsPrincipal newUser = new AccountsPrincipal(currentUser.UserName); if (newUser.Roles.Count > 0) { ArrayList roles = newUser.Roles; for (int i = 0; i < roles.Count; i++) { // RoleList.Text += "<li>" + roles[i] + "</li>"; foreach (ListItem item in CheckBoxList1.Items) { if (item.Text == roles[i].ToString()) { item.Selected = true; } } } } } }
protected void Page_Init(object sender, EventArgs e) { var _mp = new DlMainpagepopulator(); //get salaries CheckBoxList6.DataSource = _mp.GetSalary(); CheckBoxList6.DataTextField = "sTerm"; CheckBoxList6.DataValueField = "Termid"; CheckBoxList6.DataBind(); //get locations CheckBoxList2.DataSource = _mp.GetLocations(); CheckBoxList2.DataTextField = "sTerm"; CheckBoxList2.DataValueField = "Termid"; CheckBoxList2.DataBind(); //get industry CheckBoxList1.DataSource = _mp.GetIndustries(); CheckBoxList1.DataTextField = "sTerm"; CheckBoxList1.DataValueField = "Termid"; CheckBoxList1.DataBind(); if (Request.QueryString["q"] != null & Request.QueryString["q"] != "all") { TextBox2.Text = Request.QueryString["q"]; } }
protected void Carregar(object sender, EventArgs e) { DataSet ds = new DataSet(); MySqlConnection conn = new MySqlConnection(sc); conn.Open(); string sql = "SELECT * FROM produto ORDER BY nome"; MySqlDataAdapter conversor = new MySqlDataAdapter(sql, conn); conversor.Fill(ds, "tbCliente"); sql = "SELECT * FROM produto WHERE valor < 40 ORDER BY valor DESC"; conversor.SelectCommand = new MySqlCommand(sql, conn); conversor.Fill(ds, "tbPromo"); conn.Close(); CheckBoxList1.DataSource = ds.Tables["tbCliente"]; CheckBoxList1.DataTextField = "nome"; CheckBoxList1.DataBind(); GridView1.DataSource = ds.Tables["tbCliente"]; GridView1.DataBind(); DropDownList1.DataSource = ds.Tables["tbPromo"]; DropDownList1.DataTextField = "valor"; DropDownList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if ((Session[MasterPage.User] as Users)?.Rigths != 2) { Response.Redirect("login.aspx"); } if (IsPostBack) { return; } using (var context = new MainEntities()) { CheckBoxList1.DataSourceID = ""; CheckBoxList2.DataSourceID = ""; var source1 = context.Актеры.ToList(); var source2 = context.Персонажи.ToList(); CheckBoxList1.DataSource = source1.Select(o => $"{o.Имя} {o.Фамилия}").ToList(); CheckBoxList2.DataSource = source2.Select(o => $"{o.Имя} {o.Фамилия}").ToList(); CheckBoxList1.DataBind(); CheckBoxList2.DataBind(); } }
protected void Button3_Click(object sender, EventArgs e) { //USe the Azure text analytic service to parse message entered by user and extract key phrases from it and suggest them as tags Label4.Visible = true; Button1.Visible = true; dt = new DataTable(); DataColumn dc = new DataColumn("Suggested Tags"); dt.Columns.Add(dc); DataRow dr1; CheckBoxList1.DataTextField = "Suggested Tags"; if (txtHTMLContext.Text != "") { var client = new TextAnalyticsClient(endpoint, credentials); var response = client.ExtractKeyPhrases(txtHTMLContext.Text); foreach (string keyphrase in response.Value) { dr1 = dt.NewRow(); dr1[0] = keyphrase; dt.Rows.Add(dr1); CheckBoxList1.DataSource = dt; CheckBoxList1.DataBind(); } } }
public void bindept() { try { int count = 0; ds2.Dispose(); ds2.Reset(); ds2 = d2.loaddepartment(ddlcollege.SelectedValue.ToString()); CheckBoxList1.DataSource = ds2; CheckBoxList1.DataTextField = "dept_name"; CheckBoxList1.DataValueField = "Dept_Code"; CheckBoxList1.DataBind(); for (int i = 0; i < CheckBoxList1.Items.Count; i++) { CheckBoxList1.Items[i].Selected = true; if (CheckBoxList1.Items[i].Selected == true) { count += 1; } if (CheckBoxList1.Items.Count == count) { CheckBox1.Checked = true; } } } catch { } }
protected void Page_Load(object sender, EventArgs e) { con.Open(); TextBox1.Visible = false; Disp(); int count = Convert.ToInt32(TextBox1.Text); GridView1.Visible = false; for (int i = 0; i < count; i++) { if (con.State == ConnectionState.Closed) { con.Open(); } SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select prj_name from project"; SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); CheckBoxList1.DataSource = dt; CheckBoxList1.DataBind(); //CheckBoxList1.Text = dt.ToString(); con.Close(); } }
protected override void OnPreRender(EventArgs e) { if (!IsPostBack) { string[] colAlias = SampleConstants.BoundDataColumns; ArrayList ThemeList = new ArrayList(); ThemesAndModifiers.FillThemeNames(ThemeList); DropDownList1.Items.Clear(); DropDownList1.DataSource = ThemeList; DropDownList1.DataBind(); // Prepare CheckBoxes, RadioButtons and note label contents. CheckBoxList1.DataSource = colAlias; CheckBoxList1.DataBind(); CheckBoxList1.Visible = this.IsCheckBoxListVisible(ThemeList[0] as string); RadioButtonList1.DataSource = colAlias; RadioButtonList1.DataBind(); RadioButtonList1.Visible = this.IsRadioButtonListVisible(ThemeList[0] as string); Label2.Visible = this.IsNoteLabelVisible(ThemeList[0] as string); Label2.Text = "Please select two columns from below checkboxes."; DropDownList1.Items.Clear(); DropDownList1.DataSource = ThemeList; DropDownList1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { lblmsg.Text = ""; if (Page.IsPostBack == false) { BDT = BAdapter.SelectBranch(); //drpbranch.DataSource = BDT; //drpbranch.DataTextField = "Branchname"; //drpbranch.DataValueField = "Branchid"; //drpbranch.DataBind(); //drpbranch.Items.Insert(0, "SELECT"); CheckBoxList1.DataSource = BDT; CheckBoxList1.DataTextField = "Branchname"; CheckBoxList1.DataValueField = "branchid"; CheckBoxList1.DataBind(); PubDT = PubAdapter.Select(); drppublication.DataSource = PubDT; drppublication.DataTextField = "Publication"; drppublication.DataValueField = "pid"; drppublication.DataBind(); drppublication.Items.Insert(0, "SELECT"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Context.User.IsInRole("Super Admin")) { Response.Redirect("Access.aspx"); } if (!IsPostBack) { string ServLineName = Request.QueryString["ServLineName"]; ServiceLineName.Text = ServLineName; string ServLineId = Request.QueryString["ID"]; ServiceLineRepository SLRepo = new ServiceLineRepository(); SLRepo.getServLineDetails(ServLineId); SelectAllUsers selectAllUsers = new SelectAllUsers(); SLMcheckList.DataSource = SLRepo.ServLineManTab; SLMcheckList.DataTextField = "UserName"; SLMcheckList.DataValueField = "Id"; SLMcheckList.DataBind(); for (int i = 0; i < SLMcheckList.Items.Count; i++) { SLMcheckList.Items[i].Selected = true; } CheckBoxList1.DataSource = selectAllUsers.getDetails(); CheckBoxList1.DataTextField = "UserName"; CheckBoxList1.DataValueField = "Id"; CheckBoxList1.DataBind(); } }
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { try { con.Open(); string choice = DropDownList1.SelectedItem.Value; string choice1 = DropDownList2.SelectedItem.Value; Label2.Visible = true; SqlDataAdapter adapter; DataSet ds = new DataSet(); SqlCommand cmd = new SqlCommand("select * from Subjects where Department = '" + choice + "'and term= '" + choice1 + "'", con); adapter = new SqlDataAdapter(cmd); adapter.Fill(ds); CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "Subject"; CheckBoxList1.DataBind(); foreach (DataRow dr in ds.Tables[0].Rows) { credit.Add(dr["Credit"].ToString()); CourseId.Add(dr["CourseId"].ToString()); } Session["key"] = credit; Session["id"] = CourseId; } catch (Exception ex) { Label1.ForeColor = Color.Red; Label1.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet ds = new DataSet(); string Path = Server.MapPath("~/App.xml"); ds.ReadXml(Path); DropDownList1.DataSource = ds.Tables[0]; DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "Id"; DropDownList1.DataBind(); RadioButtonList1.DataSource = ds.Tables[0]; RadioButtonList1.DataTextField = "Name"; RadioButtonList1.DataValueField = "Id"; RadioButtonList1.DataBind(); ListBox1.DataSource = ds.Tables[0]; ListBox1.DataTextField = "Name"; ListBox1.DataValueField = "Id"; ListBox1.DataBind(); CheckBoxList1.DataSource = ds.Tables[0]; CheckBoxList1.DataTextField = "Name"; CheckBoxList1.DataValueField = "Id"; CheckBoxList1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["indirim"] != null) { h1Baslik.InnerText = Session["indirim"].ToString(); } //Cookie OKUMA //if (Request.Cookies["MyCookie"] != null) //{ // HttpCookie kukim = Request.Cookies["MyCookie"]; // LabelAd.Text = kukim["Ad"]; // LabelSepet.Text = kukim["Sepet"]; //} if (Request.Cookies["MyCookie"] != null) { LabelAd.Text = Request.Cookies["MyCookie"]["Ad"]; LabelSepet.Text = Request.Cookies["MyCookie"]["Sepet"]; } if (IsPostBack == false)// if(!IsPostBack) { CheckBoxList1.DataSource = repoBrand.GetAll().OrderBy(o => o.Name).ToList(); CheckBoxList1.DataBind(); RadioButtonList1.DataSource = repoBrand.GetAll().OrderBy(o => o.Name).ToList(); RadioButtonList1.DataBind(); DropDownList1.DataSource = repoBrand.GetAll().OrderBy(o => o.Name).ToList(); DropDownList1.DataBind(); GridView1.DataSource = repoBrand.GetAll().OrderBy(o => o.Name).ToList(); GridView1.DataBind(); } }
public void BindDropDownListData() { //SqlConnection con = new SqlConnection("Data Source=RND3 " + "\\" + " SQLEXPRESS;Initial Catalog=SSSolutionFiles;Integrated Security=True"); //SqlConnection mySqlConnection = new SqlConnection(); { try { con.Open(); SqlCommand mySqlCommand = new SqlCommand("Select username from userfile ", con); SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(mySqlCommand); DataSet myDataSet = new DataSet(); mySqlDataAdapter.Fill(myDataSet); //DropDownList1.DataSource = myDataSet; //DropDownList1.DataTextField = "username"; //DropDownList1.DataValueField = "username"; //DropDownList1.DataBind(); CheckBoxList1.DataSource = myDataSet; CheckBoxList1.DataTextField = "username"; CheckBoxList1.DataValueField = "username"; CheckBoxList1.DataBind(); } catch (Exception ex) { Label1.Text = ex.Message; } finally { con.Close(); } } }
//private void LoadRouteName1() //{ // try // { // CheckBoxList2.Items.Clear(); // dr = null; // dr = BLroute.getroutmasterdatareader4(companycode.ToString(), plantcode.ToString()); // if (dr.HasRows) // { // while (dr.Read()) // { // CheckBoxList2.Items.Add(dr["Tot_Distance"].ToString() + '_' + dr["ROUTE_ID"].ToString()); // } // } // else // { // } // } // catch (Exception ex) // { // } //} private void LoadRouteName() { try { ds = null; //ds = BLroute.getroutmasterdatareader3(companycode.ToString(), plantcode.ToString()); con = dbaccess.GetConnection(); DataTable DS = new DataTable(); string sqlstr; sqlstr = "select Route_ID,CAST(Route_ID as NVARCHAR)+'_'+Route_Name as Route_Name from Route_Master WHERE status=1 and Company_code='" + companycode + "' AND Plant_code='" + plantcode + "' ORDER BY ROUTE_ID "; SqlCommand cmd = new SqlCommand(sqlstr, con); SqlDataAdapter dsr = new SqlDataAdapter(cmd); rr.Rows.Clear(); dsr.Fill(rr); if (rr.Rows.Count > 0) { CheckBoxList1.DataSource = rr; CheckBoxList1.DataTextField = "ROUTE_NAME"; CheckBoxList1.DataValueField = "ROUTE_ID";//ROUTE_ID CheckBoxList1.DataBind(); } else { } } catch (Exception ex) { } }
public void filldata() { admin ad = new admin(); DataTable dt = category.fillcategory(); if (dt.Rows.Count == 0) { } else { CheckBoxList1.DataSource = dt; CheckBoxList1.DataTextField = dt.Columns["category"].ToString(); CheckBoxList1.DataValueField = dt.Columns["id"].ToString(); CheckBoxList1.DataBind(); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["visible"].ToString() == "1") { CheckBoxList1.Items[i].Selected = true; } else { CheckBoxList1.Items[i].Selected = false; } } } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { CheckBoxList1.Visible = true; CheckBoxList1.DataSource = b.callfeetype(); CheckBoxList1.DataTextField = "fee_type"; CheckBoxList1.DataValueField = "ftid"; CheckBoxList1.DataBind(); }
protected void initchecklist() { CheckBoxList1.Items.Clear(); CheckBoxList1.DataSource = c.SelectDept(); CheckBoxList1.DataTextField = "name"; CheckBoxList1.DataValueField = "code"; CheckBoxList1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { // string cate = ListBox5.SelectedValue.ToString(); Label1.Text = cate; suppliers = ssmanager.findSupplierByCategory(cate); CheckBoxList1.DataSource = suppliers; CheckBoxList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if ((string)Session["userType"] == Reference.USR_ADM) { divCompany.Visible = true; DropDownListCompany.Visible = true; // int companyID = Convert.ToInt32(DropDownListCompany.SelectedItem.Value); } else { // User userObj = new User(); // UserManagement uDao = new UserManagement(); divCompany.Visible = false; DropDownListCompany.Visible = false; // userObj = uDao.getUserByID(Session["userID"].ToString()); // int companyID = userObj.CompanyID; } //BillboardSearch.Attributes.Add("onClick", "return false;"); if (!Page.IsPostBack) { Database db = new Database(); string mainconn = ConfigurationManager.ConnectionStrings["Targeted_Marketing_DisplayConnectionString"].ConnectionString; SqlConnection sqlconn = new SqlConnection(Reference.Constr); string sqlquery = "SELECT * FROM [CodeReferece] WHERE ([CodeType] = @CodeType)"; SqlCommand cmd = new SqlCommand(sqlquery, sqlconn); cmd.Parameters.AddWithValue("@CodeType", "Category"); SqlDataAdapter sda = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); CheckBoxList1.DataSource = dt; CheckBoxList1.DataBind(); SqlCommand cmdCompany = new SqlCommand("Select * from Company where status=1"); DataTable dtCompany = db.getDataTable(cmdCompany); DropDownListCompany.DataSource = dtCompany; DropDownListCompany.DataValueField = "CompanyID"; DropDownListCompany.DataTextField = "Name"; DropDownListCompany.DataBind(); DropDownListCompany.Items.Insert(0, new ListItem("---Select A Company---", "0")); } CompareValidator1.ValueToCompare = DateTime.Now.ToShortDateString(); CompareValidator2.ValueToCompare = DateTime.Now.ToShortDateString(); if (FileUpload1.HasFile) { Literal1.Text = Convert.ToString(FileUpload1.PostedFile.FileName); if (Literal1.Text.EndsWith(".png") || Literal1.Text.EndsWith(".jpg") || Literal1.Text.EndsWith(".jpeg") || Literal1.Text.EndsWith(".gif") || Literal1.Text.EndsWith(".PNG") || Literal1.Text.EndsWith(".JPG") || Literal1.Text.EndsWith(".JPEG") || Literal1.Text.EndsWith(".GIF")) { Literal2.Text = "image"; } else { Literal2.Text = "video"; } } }
private void getContacts(string token, string lId) { long intlid = Int64.Parse(lId, System.Globalization.NumberStyles.HexNumber); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(string.Format("https://livecontacts.services.live.com/users/@C@{0}/rest/livecontacts/contacts/", intlid)); request.UserAgent = "Windows Live Data Interactive SDK"; request.ContentType = "application/xml; charset=utf-8"; request.Method = "GET"; request.Headers.Add("Authorization", "DelegatedToken dt=\"" + token + "\""); using (WebResponse response = request.GetResponse()) { using (Stream stream = response.GetResponseStream()) { //docNav = new XPathDocument(stream); StreamReader reader = new StreamReader(stream); // var contactStreamReponse = reader.ReadToEnd(); // XmlDocument contacts = new XmlDocument(); // contacts.LoadXml(contactStreamReponse); //Use the document. For example, display contacts.InnerXml. // labelXml.Text = contacts.InnerXml; if (CheckBoxList1.Items.Count < 1) { DataSet ds = new DataSet(); ds.ReadXml(reader); response.Close(); if (ds.Tables["Contact"].Rows.Count > 0) { ArrayList al = new ArrayList(); for (int intC = 0; intC < ds.Tables["Email"].Rows.Count; intC++) { //Response.Write("FOr instance" + intC); //Response.Write(ds.Tables["Email"].Rows[intC]["Address"].ToString()); ///Response.Write("<br>"); al.Add(ds.Tables["Email"].Rows[intC]["Address"].ToString()); } CheckBoxList1.DataSource = al; CheckBoxList1.DataBind(); } } else { return; } } } }
//Carrega os list box com os nomes dos exames compementares private void ExamesComplementares() { ExamesComplementaresBO ObjExamesComplementaresBO = new ExamesComplementaresBO(); CheckBoxList1.DataSource = ObjExamesComplementaresBO.DataTable(); CheckBoxList1.DataTextField = "Descricao"; CheckBoxList1.DataValueField = "id"; CheckBoxList1.DataBind(); }
protected void convert_mode_btn_Click(object sender, EventArgs e) { int flag = 0; calStatus_lbl.Text = ""; lbl_status.Text = ""; if (convert_mode_btn.Text == "Convert To Delete Mode") { flag = 1; add_btn.Enabled = false; ToDoList_txtbox.Enabled = false; CheckBoxList1.Visible = false; Del_List_Box.Visible = true; del_btn.Visible = true; convert_mode_btn.Text = "Convert To Add Mode"; //display todolist try { DataTable dt = new DataTable(); int UserID = Convert.ToInt32(Session["UserID"]); DateTime Date = Calendar1.SelectedDate == new DateTime(1, 1, 1) ? DateTime.Now : Calendar1.SelectedDate; int CatID = Convert.ToInt32(ddl_category.SelectedItem.Value); //string ToDoList = ToDoList_txtbox.Text; dt = AccessLayer.ToDoList.selectbydatecat(UserID, CatID, new DateTime(Date.Year, Date.Month, Date.Day)); Del_List_Box.DataSource = dt; Del_List_Box.DataTextField = "Todolist"; Del_List_Box.DataValueField = "ID"; Del_List_Box.DataBind(); } catch { calStatus_lbl.Text = "u should select date"; } } if (flag == 0 && convert_mode_btn.Text == "Convert To Add Mode") { add_btn.Enabled = true; ToDoList_txtbox.Enabled = true; CheckBoxList1.Visible = true; Del_List_Box.Visible = false; del_btn.Visible = false; convert_mode_btn.Text = "Convert To Delete Mode"; DataTable dt = new DataTable(); int UserID = Convert.ToInt32(Session["UserID"]); DateTime Date = Calendar1.SelectedDate == new DateTime(1, 1, 1) ? DateTime.Now : Calendar1.SelectedDate; int CatID = Convert.ToInt32(ddl_category.SelectedItem.Value); //string ToDoList = ToDoList_txtbox.Text; dt = AccessLayer.ToDoList.selectbydatecat(UserID, CatID, new DateTime(Date.Year, Date.Month, Date.Day)); CheckBoxList1.DataSource = AccessLayer.ToDoList.selectbydatecat(UserID, CatID, Date); CheckBoxList1.DataTextField = "Todolist"; CheckBoxList1.DataValueField = "ID"; CheckBoxList1.DataBind(); } }
protected void FillCheckBox(int classid) { DataTable dt = BLL.File.BLLGetClassFile(classid); CheckBoxList1.DataSource = dt; CheckBoxList1.DataValueField = dt.Columns[0].ColumnName; CheckBoxList1.DataTextField = dt.Columns[1].ColumnName; CheckBoxList1.DataBind(); }
private void bindcheckboxlist() { DataSet ds = nd.GetAllTags(); CheckBoxList1.DataSource = ds.Tables[0]; CheckBoxList1.DataTextField = "TagName"; CheckBoxList1.DataValueField = "TagID"; CheckBoxList1.DataBind(); }