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


C# TableRow.RenderEndTag方法代码示例

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


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

示例1: RenderContents

		/// <summary>
		/// 
		/// </summary>
		/// <param name="writer"></param>
		/// <author>
		/// Created by Iulian Iuga; 30 December, 2002
		/// </author>		
		protected void RenderContents( HtmlTextWriter writer )
		{
			TableRow _tr = new TableRow();
			TableCell _td = new TableCell();

			_tr.RenderBeginTag( writer );
			
			// apply CssClass for current element
			if( _element.TreeWeb.DefaultElementCssClass.Length > 0 )
				_td.CssClass = _element.TreeWeb.DefaultElementCssClass;
			if( _element.CssClass.Length > 0 )
				_td.CssClass = _element.CssClass;

			//_td.Style.Add( "display", "none" );
			_td.Attributes.Add( "nowrap", "yes" );
			_td.RenderBeginTag( writer );

			// render a &nbsp; at the begining of each element
			writer.Write( "&nbsp;" );

			// render element indentation based on element level
			string _indentation = "";
      int nIndentationPerStep = _element.TreeWeb.Indentation;
			for( int index = 0; index < (_element.Level * nIndentationPerStep); index++ )
				_indentation += _indentationStep;
			writer.Write( _indentation );

			// render the expand/collapse link if the element has child elements and is expandable.
			if( _element.HasElements )
			{
				HyperLink _link = new HyperLink();
				Image _image = new Image();

        if( _element.TreeWeb.Expandable && _element.Expandable )
        {
          if( _element.IsExpanded )
          {
            _link.Text = _expcol[1];
            if( _element.TreeWeb.ExpandedElementImage.Length > 0 )
              _image.ImageUrl = _element.TreeWeb.ExpandedElementImage;
          }
          else
          {
            _link.Text = _expcol[0];
            if( _element.TreeWeb.CollapsedElementImage.Length > 0 )
              _image.ImageUrl = _element.TreeWeb.CollapsedElementImage;
          }
        }

				string scriptCode = "javascript:";
				scriptCode += _element.TreeWeb.Page.GetPostBackEventReference( _element.TreeWeb, _element.ID );
				_link.NavigateUrl = scriptCode;

				if( _image.ImageUrl.Length > 0 )
				{
					_link.RenderBeginTag( writer );
					_image.RenderControl( writer );
					_link.RenderEndTag( writer );
				}
				else
					_link.RenderControl( writer );

				_image = null;
				_link = null;
				writer.Write( "&nbsp;" );
			}

			// render checkbox
			if( _element.TreeWeb.CheckBoxes || _element.CheckBox )
			{
				CheckBox _checkbox = new CheckBox();
				
				_checkbox.ID = _element.ID + TreeElement._separator + TreeElement._checkboxIDSufix;
				_checkbox.RenderControl( writer );

				_checkbox = null;
				
				// write a non-breaking space before the element text
				writer.Write( "&nbsp;" );
			}

			// render element's image if it has one
			if( _element.ImageIndex > -1 )
			{
				ElementImage _elementImage = _element.TreeWeb.ImageList[_element.ImageIndex];
				if( _elementImage != null )
				{
					Image _image = new Image();

					_image.ImageUrl = _elementImage.ImageUrl;
					_image.RenderControl( writer );

					_image = null;
//.........这里部分代码省略.........
开发者ID:dineshkummarc,项目名称:Portal-V2.8.1,代码行数:101,代码来源:TreeElementWriter.cs


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