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


C# Panel.RenderBeginTag方法代码示例

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


在下文中一共展示了Panel.RenderBeginTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderBeginTag

 protected override void RenderBeginTag(HtmlTextWriter writer) {
     Menu owner = Control;
     // skip link
     if (owner.SkipLinkText.Length != 0) {
         HyperLink skipLink = new HyperLink();
         skipLink.NavigateUrl = '#' + owner.ClientID + "_SkipLink";
         skipLink.ImageUrl = owner.SpacerImageUrl;
         skipLink.Text = owner.SkipLinkText;
         skipLink.Height = Unit.Pixel(1);
         skipLink.Width = Unit.Pixel(1);
         skipLink.Page = Page;
         skipLink.RenderControl(writer);
     }
     _menuPanel = new Panel();
     _menuPanel.ID = owner.UniqueID;
     _menuPanel.Page = Page;
     // Determine root menu style
     MenuItem titleItem;
     if (_path != null) {
         titleItem = owner.Items.FindItem(_path.Split(TreeView.InternalPathSeparator), 0);
         _titleItem = titleItem;
     }
     else {
         titleItem = owner.RootItem;
     }
     SubMenuStyle rootMenuStyle = owner.GetSubMenuStyle(titleItem);
     if (!rootMenuStyle.IsEmpty) {
         if (Page != null && Page.SupportsStyleSheets) {
             string styleClass = owner.GetSubMenuCssClassName(titleItem);
             if (styleClass.Trim().Length > 0) {
                 _menuPanel.CssClass = styleClass;
             }
         }
         else {
             _menuPanel.ApplyStyle(rootMenuStyle);
         }
     }
     _menuPanel.Width = owner.Width;
     _menuPanel.Height = owner.Height;
     _menuPanel.Enabled = owner.IsEnabled;
     _menuPanel.RenderBeginTag(writer);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:42,代码来源:MenuAdapter.cs

示例2: Render

        protected override void Render(HtmlTextWriter w)
        {
            base.RenderBeginTag(w);

            foreach (Control c in Controls)
            {
                Panel p = new Panel();
                if (c.GetType().GetInterfaces().Contains(typeof(IQubeFormField)) && c.Parent.GetType() == typeof(QubeStandardPanel))
                {
                    IQubeFormField fld = c as IQubeFormField;

                    if(RenderFieldsOuterDiv)
                        p.RenderBeginTag(w);
                    HtmlCustomControl lbField = new HtmlCustomControl("label");
                    lbField.Attributes["for"] = c.ClientID;
                    lbField.Controls.Add(new Literal() { Text = ((IQubeFormField)c).DisplayName + ":" });
                    HtmlCustomControl span = new HtmlCustomControl("span");
                    if (!string.IsNullOrEmpty(fld.DisplayName))
                    {
                        lbField.RenderControl(w);
                        span.RenderBeginTag(w);
                    }
                    c.RenderControl(w);
                    if (!string.IsNullOrEmpty(fld.DisplayName))
                        span.RenderEndTag(w);
                    if (RenderFieldsOuterDiv)
                        p.RenderEndTag(w);
                    continue;
                }
                else if (c.GetType() == typeof(Captcha))
                {
                    if (RenderFieldsOuterDiv)
                        p.RenderBeginTag(w);
                    HtmlCustomControl lbField = new HtmlCustomControl("label");
                    lbField.Controls.Add(new Literal() { Text = " " });
                    HtmlCustomControl span = new HtmlCustomControl("span");
                    lbField.RenderControl(w);
                    span.RenderBeginTag(w);
                    c.RenderControl(w);
                    span.RenderEndTag(w);
                    if (RenderFieldsOuterDiv)
                        p.RenderEndTag(w);
                }
                else
                    c.RenderControl(w);
            }

            base.RenderEndTag(w);
        }
开发者ID:darkguy2008,项目名称:qube,代码行数:49,代码来源:QubeStandardForm.cs


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