当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.Panel类代码示例

本文整理汇总了C#中System.Web.UI.WebControls.Panel的典型用法代码示例。如果您正苦于以下问题:C# Panel类的具体用法?C# Panel怎么用?C# Panel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Panel类属于System.Web.UI.WebControls命名空间,在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=F:\git\web-application-dev\online_album\App_Data\Database1.mdf;Integrated Security=True"); //创建连接对象
            con.Open();
            SqlCommand cmd = new SqlCommand("select * from [photo]", con);
            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                Panel box = new Panel();
                box.CssClass = "box";
                Panel1.Controls.Add(box);

                Image photo = new Image();
                photo.CssClass = "photo";
                photo.ImageUrl = "~/Images/" + dr["uid"].ToString() + "/" + dr["filename"].ToString(); ;
                box.Controls.Add(photo);

                box.Controls.Add(new Literal() { Text = "<br />" });

                Label uid = new Label();
                uid.Text = dr["uid"].ToString();
                box.Controls.Add(uid);

                box.Controls.Add(new Literal() { Text = "<br />" });

                Label datetime = new Label();
                datetime.Text = dr["datetime"].ToString();
                box.Controls.Add(datetime);
            }
        }
开发者ID:do-you,项目名称:web-application-dev,代码行数:31,代码来源:index.aspx.cs

示例2: PopulateCarousel

        private void PopulateCarousel()
        {
            List<BLCategory> categories = BLCategory.RetrieveListFromDB(connectionString);
            foreach (BLCategory category in categories)
            {
                Image image = new Image
                {
                    CssClass = "carousel-image",
                    ImageUrl = $"ImgHandler.ashx?categoryId={category.Id}"
                };
                HyperLink link = new HyperLink
                {
                    NavigateUrl = $"/Result.aspx?categoryId={category.Id}"
                };
                link.Controls.Add(image);

                Label captionLabel = new Label
                {
                    Text = $"<h3 style = 'color: #FFFFFF' > {category.Name} </ h3 >"
                };
                Panel captionPanel = new Panel { CssClass = "carousel-caption" };
                captionPanel.Controls.Add(captionLabel);

                Panel itemPanel = new Panel { CssClass = "item" };
                itemPanel.Controls.Add(link);
                itemPanel.Controls.Add(captionPanel);

                categoryCarousel.Controls.Add(itemPanel);
            }
        }
开发者ID:KodKnackarGanget,项目名称:E-Handel,代码行数:30,代码来源:Home.aspx.cs

示例3: AddUpdatePanel

        private void AddUpdatePanel(Panel p)
        {
            this.messageLabel = new Label();

            this.updatePanel = new UpdatePanel();
            this.updatePanel.ID = "ScrudUpdatePanel";
            this.updatePanel.ChildrenAsTriggers = true;
            this.updatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.topCommandPanel.GetCommandPanel("top"));
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.messageLabel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.gridPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.formPanel);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.bottomCommandPanel.GetCommandPanel("bottom"));

            //Bottom command panel.
            this.userIdHidden = new HiddenField();
            this.userIdHidden.ID = "UserIdHidden";
            this.userIdHidden.Value = this.UserId.ToString(CultureInfo.InvariantCulture);

            this.officeCodeHidden = new HiddenField();
            this.officeCodeHidden.ID = "OfficeCodeHidden";
            this.officeCodeHidden.Value = this.OfficeCode;

            this.updatePanel.ContentTemplateContainer.Controls.Add(this.userIdHidden);
            this.updatePanel.ContentTemplateContainer.Controls.Add(this.officeCodeHidden);
            p.Controls.Add(this.updatePanel);
        }
开发者ID:JonathanValle,项目名称:mixerp,代码行数:28,代码来源:UpdatePanel.cs

示例4: AddReportBody

        private void AddReportBody(Panel container)
        {
            this.reportBody = new Panel();
            this.reportBody.ID = "report";

            if (!this.NoHeader)
            {
                this.header = new ReportHeader();
                this.header.Path = ConfigurationHelper.GetReportParameter("HeaderPath");
                this.reportBody.Controls.Add(this.header);
            }

            this.reportTitleLiteral = new Literal();
            this.reportBody.Controls.Add(this.reportTitleLiteral);

            this.topSectionLiteral = new Literal();
            this.reportBody.Controls.Add(this.topSectionLiteral);

            this.bodyContentsLiteral = new Literal();
            this.reportBody.Controls.Add(this.bodyContentsLiteral);

            this.gridPlaceHolder = new PlaceHolder();
            this.reportBody.Controls.Add(this.gridPlaceHolder);

            this.bottomSectionLiteral = new Literal();
            this.reportBody.Controls.Add(this.bottomSectionLiteral);

            container.Controls.Add(this.reportBody);
        }
开发者ID:abinabrahamanchery,项目名称:mixerp,代码行数:29,代码来源:Body.cs

示例5: CreateControlInternal

        protected override WebControl CreateControlInternal(Control container)
        {
            var panel = new Panel();

            container.Controls.Add(panel);

            var skinLabel = new Label { Text = LocalizeString("Skin") };
            skinLabel.CssClass += "dnnFormSkinLabel";
            panel.Controls.Add(skinLabel);

            //_skinCombo = new DropDownList { ID = ID + "_SkinComboBox" };
            _skinCombo = new DnnComboBox { ID = ID + "_SkinComboBox" };
            _skinCombo.CssClass += "dnnFormSkinInput"; 
            _skinCombo.SelectedIndexChanged += SkinIndexChanged;
            panel.Controls.Add(_skinCombo);

            DnnFormComboBoxItem.BindListInternal(_skinCombo, _skinValue, GetSkins(SkinController.RootSkin), "Key", "Value");

            var containerLabel = new Label { Text = LocalizeString("Container") };
            containerLabel.CssClass += "dnnFormSkinLabel";
            panel.Controls.Add(containerLabel);

            //_containerCombo = new DropDownList { ID = ID + "_ContainerComboBox" };
            _containerCombo = new DnnComboBox { ID = ID + "_ContainerComboBox" };
            _containerCombo.CssClass += "dnnFormSkinInput";
            _containerCombo.SelectedIndexChanged += ContainerIndexChanged;
            panel.Controls.Add(_containerCombo);

            DnnFormComboBoxItem.BindListInternal(_containerCombo, _containerValue, GetSkins(SkinController.RootContainer), "Key", "Value");

            return panel;
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:32,代码来源:DnnFormSkinsItem.cs

示例6: OnInit

        protected override void OnInit(EventArgs e)
        {
            _Panel = new Panel();
            _Panel.ID = this.ID + "_Container";
            _Panel.CssClass = "RibbonItems RibbonItems_SmallItem RibbonItemWithMenu";
            _Panel.Attributes.Add("ItemID", this.ID);
            if (this._width != null) _Panel.Style.Add("width", _width.ToString());
            this.Controls.Add(_Panel);

            _EnableState(this._enabled);

            if (!String.IsNullOrEmpty(this._tooltip))
            {
                _Panel.CssClass += " RibbonItemWithTooltip";
                _Panel.Attributes.Add("tooltip", this._tooltip);
            }

            Table lTable = new Table();
            lTable.Attributes.Add("align", "center");
            _Panel.Controls.Add(lTable);

            TableRow lTableRow = new TableRow();
            lTable.Controls.Add(lTableRow);

            TableCell lTableCell = new TableCell();
            lTableRow.Controls.Add(lTableCell);

            Image lImage = new Image();
            lImage.ImageUrl = (!String.IsNullOrEmpty(this._imageurl)) ? this._imageurl : Page.ClientScript.GetWebResourceUrl(this.GetType(), "OfficeWebUI.Resources.Common.Image.blank.gif");
            lImage.Width = 16;
            lImage.Height = 16;
            lTableCell.Controls.Add(lImage);

            TableCell lTableCellArrow = new TableCell();
            lTableRow.Controls.Add(lTableCellArrow);

            Image lArrow = new Image();
            lArrow.ImageUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "OfficeWebUI.Resources.Common.Image.arrow_dr2.gif");
            lTableCellArrow.Controls.Add(lArrow);

            _DropDownMenu = new Panel();
            _DropDownMenu.ID = this.ID + "_Menu";
            _DropDownMenu.CssClass = "RibbonDropDownMenu";
            _DropDownMenu.Style.Add("display", "none");
            _Panel.Controls.Add(_DropDownMenu);

            foreach (Control lCtrl in this._items)
            {
                _DropDownMenu.Controls.Add(lCtrl);
            }

            /*
            lPanel.Attributes.Add("onclick", "OfficeWebUI.Ribbon.ShowMenu(this, '" + lDropDownMenu.ClientID + "')");
            lDropDownMenu.Attributes.Add("onmouseover", "OfficeWebUI.Ribbon.KeepMenu('" + lDropDownMenu.ClientID + "')");
            lDropDownMenu.Attributes.Add("onmouseout", "OfficeWebUI.Ribbon.HideMenu('" + lDropDownMenu.ClientID + "')");
            lDropDownMenu.Attributes.Add("MenuOpener", lPanel.ClientID);
            */

            base.OnInit(e);
        }
开发者ID:trankimhieu,项目名称:eCommerce-MVC,代码行数:60,代码来源:SmallItemDropDown.cs

示例7: LoadGridPanel

        private void LoadGridPanel(Panel gridPanel)
        {
            gridPanel.ID = "GridPanel";
            gridPanel.CssClass = this.GridPanelCssClass;
            gridPanel.Attributes.Add("style", "overflow:auto");
            gridPanel.Attributes.Add("padding", "4px");

            if (this.GridPanelHeight.Value > 0)
            {
                gridPanel.Height = this.GridPanelHeight;
            }

            if (this.GridPanelWidth.Value > 0)
            {
                gridPanel.Height = this.GridPanelWidth;
            }

            this.searchGridView = new MixERPGridView();
            this.searchGridView.ID = "SearchGridView";

            this.searchGridView.Attributes.Add("style", "white-space: nowrap;");
            this.searchGridView.GridLines = GridLines.None;
            this.searchGridView.CssClass = this.GridViewCssClass;
            this.searchGridView.PagerStyle.CssClass = this.GridViewPagerCssClass;
            this.searchGridView.RowStyle.CssClass = this.GridViewRowCssClass;
            this.searchGridView.AlternatingRowStyle.CssClass = this.GridViewAlternateRowCssClass;
            this.searchGridView.AutoGenerateColumns = true;
            this.searchGridView.RowDataBound += this.SearchGridView_RowDataBound;
            this.searchGridView.Columns.Add(GetSelectColumnTemplateField());

            gridPanel.Controls.Add(this.searchGridView);
        }
开发者ID:varcharli,项目名称:mixerp,代码行数:32,代码来源:ItemSelector.cs

示例8: Ini

 public override void Ini()
 {
     CssClass = "_devices";
     burnerList = new Dictionary<string, Devices>();
     burnerList = ((Bake)deviceList[name]).GetBurnerList();
     bakeOvenList = ((Bake)deviceList[name]).GetBakeOvenList();
     panelName = new Panel();
     panelName.CssClass = "_bakePanelName";
     labelName = new Label();
     labelName.Text = name;
     panelName.Controls.Add(labelName);
     buttonDelete = new Button();
     buttonDelete.Text = "X";
     buttonDelete.CssClass = "_buttonDelete";
     buttonDelete.Click += Delete_Click;
     Controls.Add(panelName);
     Controls.Add(buttonDelete);
     foreach (var burner in burnerList)
     {
         Controls.Add(((IDraw)burner.Value).Draw(burner.Key, burnerList));
     }
     foreach (var oven in bakeOvenList)
     {
         Controls.Add(((IDraw)oven.Value).Draw(oven.Key, bakeOvenList));
     }
 }
开发者ID:anatoliyshulika,项目名称:HomeWebForm,代码行数:26,代码来源:BakeDraw.cs

示例9: CreateControls

        private void CreateControls()
        {
            _panel = new Panel();
            _panel.CssClass = "panVolume";

            _image = new Image();
            _image.ImageUrl = "~/Images/sound_low.png";
            _image.CssClass = "imgBt";
            _panel.Controls.Add(_image);

            _imBtAdd = new ImageButton();
            _imBtAdd.ImageUrl = "~/Images/up_plus.png";
            _imBtAdd.CssClass = "imgBtV";
            _imBtAdd.Click += _imBtAdd_Click;
            _panel.Controls.Add(_imBtAdd);

            _volumeLabel = new Label();
            _volumeLabel.Text = ((IVolume)_data.Device).Volume.ToString();
            _volumeLabel.CssClass = "labelVolume";
            _panel.Controls.Add(_volumeLabel);

            _imBtDel = new ImageButton();
            _imBtDel.ImageUrl = "~/Images/down_minus.png";
            _imBtDel.CssClass = "imgBt imgBtV";
            _imBtDel.Click += _imBtDel_Click;
            _panel.Controls.Add(_imBtDel);

            Controls.Add(_panel);
        }
开发者ID:alermar69,项目名称:SmartHouseWebForms,代码行数:29,代码来源:VolumeContol.cs

示例10: ShowPanelPage

        public void ShowPanelPage(Panel _panel)
        {
            try
            {
                if (Request.QueryString["page"] != null)
                {
                    if (Session["page"] != null)
                    {
                        if (!Session["page"].Equals(Request.QueryString["page"]))
                        {
                            _panel.Visible = true;
                        }
                        else
                        {
                            _panel.Visible = false;
                        }
                    }

                    Session["page"] = Request.QueryString["page"];
                }
                else
                {
                    Session["page"] = 1;
                }
            }
            catch (Exception)
            {

            }
        }
开发者ID:quocdunginfo,项目名称:QuanLyTaiSan,代码行数:30,代码来源:ucCollectionPager.ascx.cs

示例11: GenerateShopControls

        //Fill page with dynamic controls showing products in database
        private void GenerateShopControls()
        {
            ArrayList coffeeList = ConnectionClass.GetCoffeeByType("%");

            foreach (Coffee coffee in coffeeList)
            {
                //Create Controls
                Panel coffeePanel = new Panel();
                Image image = new Image { ImageUrl = coffee.Image, CssClass = "ProductsImage" };
                Literal literal = new Literal { Text = "<br />" };
                Literal literal2 = new Literal { Text = "<br />" };
                Label lblName = new Label { Text = coffee.Name, CssClass = "ProductsName" };
                Label lblPrice = new Label { Text = String.Format("{0:0.00}",coffee.Price) + "<br />", CssClass = "ProductsPrice" };
                TextBox textBox = new TextBox {ID = coffee.Id.ToString(), CssClass = "ProductsTextBox", Text = "0", Width = 60};

                //Add validation so only numbers can be entered into the textfields
                var validator = new RegularExpressionValidator
                                    {
                                        ValidationExpression = "^[0-9]*",
                                        ControlToValidate = textBox.ID,
                                        ErrorMessage = "Please enter a number."
                                    };

                //Add controls to Panels
                coffeePanel.Controls.Add(image);
                coffeePanel.Controls.Add(literal);
                coffeePanel.Controls.Add(lblName);
                coffeePanel.Controls.Add(literal2);
                coffeePanel.Controls.Add(lblPrice);
                coffeePanel.Controls.Add(textBox);
                coffeePanel.Controls.Add(validator);

                pnlProducts.Controls.Add(coffeePanel);
            }
        }
开发者ID:kgrabek,项目名称:WebApp,代码行数:36,代码来源:Shop.aspx.cs

示例12: LoadGridPanel

        private void LoadGridPanel(Panel gridPanel)
        {
            gridPanel.ID = "GridPanel";
            gridPanel.ScrollBars = ScrollBars.Auto;
            gridPanel.CssClass = this.GridPanelCssClass;

            if (this.GridPanelHeight != null)
            {
                gridPanel.Height = this.GridPanelHeight;
            }

            if (this.GridPanelWidth != null)
            {
                gridPanel.Height = this.GridPanelWidth;
            }

            searchGridView = new GridView();
            searchGridView.ID = "SearchGridView";
            searchGridView.GridLines = GridLines.None;
            searchGridView.CssClass = this.GridViewCssClass;
            searchGridView.PagerStyle.CssClass = this.GridViewPagerCssClass;
            searchGridView.RowStyle.CssClass = this.GridViewRowCssClass;
            searchGridView.AlternatingRowStyle.CssClass = this.GridViewAlternateRowCssClass;
            searchGridView.AutoGenerateColumns = true;
            searchGridView.RowDataBound += this.SearchGridView_RowDataBound;
            searchGridView.Columns.Add(this.GetSelectColumnTemplateField());

            gridPanel.Controls.Add(searchGridView);
        }
开发者ID:hadoan,项目名称:mixerp,代码行数:29,代码来源:ItemSelector.cs

示例13: AddEmailAnchor

 private void AddEmailAnchor(Panel p)
 {
     emailAnchor = new HtmlAnchor();
     emailAnchor.ID = "SendEmailAnchor";
     emailAnchor.InnerHtml = "<img src='" + this.Page.ResolveUrl(MixERP.Net.Common.Helpers.ConfigurationHelper.GetReportParameter("EmailIcon")) + "' />";
     p.Controls.Add(emailAnchor);
 }
开发者ID:n4gava,项目名称:mixerp,代码行数:7,代码来源:CommandPanel.cs

示例14: renderSimilarProduct

        private Panel renderSimilarProduct(Item item)
        {
            Panel similarProductsItemContainer = new Panel();
            similarProductsItemContainer.CssClass = "SimilarProductsItemContainer";
            Table table = new Table();
            TableRow tableRow = new TableRow();

            TableCell tableCell = new TableCell();
            Panel itemImageBg = new Panel();
            itemImageBg.CssClass = "itemImageBg";
            Image image = new Image();
            image.ImageUrl = item.ImageUrl;

            itemImageBg.Controls.Add(image);
            tableCell.Controls.Add(itemImageBg);
            tableRow.Controls.Add(tableCell);

            tableCell = new TableCell();
            Panel itemImageTitle = new Panel();
            itemImageTitle.CssClass = "itemImageTitle";
            Label label = new Label();
            label.Text = item.Title;
            itemImageTitle.Controls.Add(label);
            tableCell.Controls.Add(itemImageTitle);
            tableRow.Controls.Add(tableCell);

            table.Controls.Add(tableRow);
            similarProductsItemContainer.Controls.Add(table);

            return similarProductsItemContainer;
        }
开发者ID:MYMMoonDT,项目名称:Vneed,代码行数:31,代码来源:SimilarProductsControl.ascx.cs

示例15: BuildCategoryPanel

        public static Panel BuildCategoryPanel(BlogEntry entry)
        {
            Panel categoriesPanel = new Panel();
            categoriesPanel.CssClass = "blogPostLabel";
            categoriesPanel.Style.Add(HtmlTextWriterStyle.TextAlign, "right");

            if (entry.Categories.Count > 0)
            {
                String category = entry.Categories[0];
                HyperLink hyperLink = new HyperLink();
                hyperLink.NavigateUrl = "blog.aspx?label=" + category;
                hyperLink.Text = category;
                categoriesPanel.Controls.Add(hyperLink);
            }

            for (int i = 1; i < entry.Categories.Count; i++)
            {
                String category = entry.Categories[i];
                Literal labelSeparator = new Literal();
                labelSeparator.Text = ", ";
                categoriesPanel.Controls.Add(labelSeparator);

                HyperLink hyperLink = new HyperLink();
                hyperLink.NavigateUrl = "blog.aspx?label=" + category;
                hyperLink.Text = category;
                categoriesPanel.Controls.Add(hyperLink);
            }

            return categoriesPanel;
        }
开发者ID:Letractively,项目名称:rpcwc,代码行数:30,代码来源:BlogHelper.cs


注:本文中的System.Web.UI.WebControls.Panel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。