Ejemplo n.º 1
0
        private void LoopRepeater()
        {
            panView.Visible = true;
            DataSet  ds = oDell.Gets(0);
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"].ToString();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            foreach (RepeaterItem ri in rptView.Items)
            {
                ImageButton oDelete = (ImageButton)ri.FindControl("btnDelete");
                oDelete.Attributes.Add("onClick", "return confirm('Are you sure you want to delete this item?');");
                ImageButton oEnable = (ImageButton)ri.FindControl("btnEnable");
                if (oEnable.ImageUrl == "/admin/images/enabled.gif")
                {
                    oEnable.ToolTip = "Click to disable";
                    oEnable.Attributes.Add("onClick", "return confirm('Are you sure you want to disable this item?');");
                }
                else
                {
                    oEnable.ToolTip = "Click to enable";
                }
            }
        }
Ejemplo n.º 2
0
 private void LoadList()
 {
     ddlAssetCategory.DataTextField  = "AssetCategoryName";
     ddlAssetCategory.DataValueField = "id";
     ddlAssetCategory.DataSource     = oAssetCategory.Gets(1);
     ddlAssetCategory.DataBind();
     ddlAssetCategory.Items.Insert(0, new ListItem("-- Select --", "0"));
     ddlChipset.DataTextField  = "name";
     ddlChipset.DataValueField = "id";
     ddlChipset.DataSource     = oModel.GetChipsets(1);
     ddlChipset.DataBind();
     ddlChipset.Items.Insert(0, new ListItem("-- Select --", "0"));
     ddlDell.DataTextField  = "name";
     ddlDell.DataValueField = "id";
     ddlDell.DataSource     = oDell.Gets(1);
     ddlDell.DataBind();
     ddlDell.Items.Insert(0, new ListItem("-- Select --", "0"));
 }