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


C# HtmlTextWriter.RenderA方法代码示例

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


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

示例1: RenderNext

		/// <summary>
		/// Renders the "next" link.
		/// </summary>
		/// <param name="currentPage">The page that should be rendered.</param>
		/// <param name="writer">The HtmlTextWriter fro the request.</param>
		private void RenderNext(int currentPage, HtmlTextWriter writer)
		{
			if (currentPage == Paginator.PageCount - 1)
			{
				return;
			}

			var url = this.GetPageUrl(currentPage + 1);

			using (writer.RenderLi())
			{
				using (writer.RenderA(url))
				{
					writer.Write("Next");
				}
			}
		}
开发者ID:sitecorerick,项目名称:constellation.webforms,代码行数:22,代码来源:PaginationControl.cs

示例2: RenderPageLinks

		/// <summary>
		/// Renders the page links.
		/// </summary>
		/// <param name="currentPage">The current page to render.</param>
		/// <param name="writer">The <see cref="HtmlTextWriter"/> to render the controls through.</param>
		private void RenderPageLinks(int currentPage, HtmlTextWriter writer)
		{
			int left, right;
			SetBounds(1, Paginator.PageCount - 2, currentPage, this.MaxLinks - 2, out left, out right);

			for (var i = 0; i < Paginator.PageCount; i++)
			{
				if (!this.ShowLink(i, left, right))
				{
					if (i == left - 1 || i == right + 1)
					{
						using (writer.RenderLi(cssClass: "disabled"))
						{
							using (writer.RenderA("#"))
							{
								writer.Write("...");
							}
						}
					}

					continue;
				}

				var pageUrl = this.GetPageUrl(i);
				var pageNumber = PageNumber(i);
				var css = i == currentPage ? "active" : string.Empty;

				using (writer.RenderLi(cssClass: css))
				{
					using (writer.RenderA(pageUrl))
					{
						writer.Write(pageNumber.ToString(CultureInfo.InvariantCulture));
					}
				}
			}
		}
开发者ID:sitecorerick,项目名称:constellation.webforms,代码行数:41,代码来源:PaginationControl.cs

示例3: RenderPrev

		/// <summary>
		/// Renders the "previous" link.
		/// </summary>
		/// <param name="currentPage">The page that should be rendered.</param>
		/// <param name="writer">The HtmlTextWriter for the request.</param>
		private void RenderPrev(int currentPage, HtmlTextWriter writer)
		{
			if (currentPage == 0)
			{
				return;
			}

			string url = this.GetPageUrl(currentPage - 1);

			using (writer.RenderLi())
			{
				using (writer.RenderA(url))
				{
					writer.Write("Prev");
				}
			}
		}
开发者ID:sitecorerick,项目名称:constellation.webforms,代码行数:22,代码来源:PaginationControl.cs


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