本文整理汇总了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");
}
}
}
示例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));
}
}
}
}
示例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");
}
}
}