/// <summary> /// 构建分页链接 /// </summary> /// <param name="text">分页显示的文本</param> /// <param name="index">分页标签的页码</param> /// <param name="isUnEnable">是否为可用页码</param> /// <returns></returns> protected string BuildSplitString(string text, int index, PagerElementEnum pType) { if (!PagerUrlFunc.IsNullOrEmpty()) { return(PagerUrlFunc(text, index, pType)); } if (pType == PagerElementEnum.UnPage) { return(UnEnablePagerSplitHtml.Replace("{Text}", text)); } else { var url = GetUrlByIndex(index); return(GetTemplateString(pType).Replace("{Url}", url).Replace("{Text}", text)); } }
/// <summary> /// 根据页码类型获取Html模板 /// </summary> /// <param name="pElType"></param> /// <returns></returns> public string GetTemplateString(PagerElementEnum pElType) { var val = string.Empty; switch (pElType) { case PagerElementEnum.First: val = FirstPagerSplitHtml; break; case PagerElementEnum.Last: val = LastPagerSplitHtml; break; case PagerElementEnum.LightPage: val = CurrentPagerSplitHtml; break; case PagerElementEnum.Next: val = NextPagerSplitHtml; break; case PagerElementEnum.NextGroup: val = NextGroupHtml; break; case PagerElementEnum.Page: val = PagerSplitHtml; break; case PagerElementEnum.Prev: val = PrevPagerSplitHtml; break; case PagerElementEnum.PrevGroup: val = PrevGroupHtml; break; case PagerElementEnum.UnPage: val = UnEnablePagerSplitHtml; break; } return(val); }