Codematic2.0中的PageControl部分源代码 -4
2010-01-29 14:29
155 查看
Source code of Page3
using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Gauss.PageControl { [DefaultProperty("Text")] [ToolboxData("<{0}:Page03 runat=server></{0}:Page03>")] public class Page03 : WebControl { // Fields private int page_Count; private int page_Current; private string page_Index; private int page_Size; private int page_width; private int pageStep; private int record_Count; public Page03() { this.page_Size = 10; this.page_Current = 1; this.page_Index = "index.aspx"; this.pageStep = 6; this.page_width = 700; } public int Page_Count { get { return this.page_Count; } set { this.page_Count = value; } } public int Page_Current { get { return this.page_Current; } set { this.page_Current = value; } } public string Page_Index { get { return this.page_Index; } set { this.page_Index = value; } } public int Page_Size { get { return this.page_Size; <mce:script type="text/javascript" src="http://hi.images.csdn.net/js/blog/tiny_mce/themes/advanced/langs/zh.js" mce_src="http://hi.images.csdn.net/js/blog/tiny_mce/themes/advanced/langs/zh.js"></mce:script><mce:script type="text/javascript" src="http://hi.images.csdn.net/js/blog/tiny_mce/plugins/syntaxhl/langs/zh.js" mce_src="http://hi.images.csdn.net/js/blog/tiny_mce/plugins/syntaxhl/langs/zh.js"></mce:script> } set { this.page_Size = value; } } [DefaultValue(""), Bindable(true), Category("Appearance")] public int Page_Width { get { return this.page_width; } set { this.page_width = value; } } public int PageStep { get { return this.pageStep; } set { this.pageStep = value; } } public int Record_Count { get { return this.record_Count; } set { this.record_Count = value; } } protected override void Render(HtmlTextWriter output) { StringBuilder builder1 = new StringBuilder(""); builder1.Append("<table width=/"" + this.page_width + "/" border=/"0/" cellspacing=/"0/" cellpadding=/"0/" align=/"center/" height=/"22/">/n"); builder1.Append("/t<tr>/n"); builder1.Append("/t/t<td width=/"255/">"); builder1.Append(string.Concat(new object[] { "/u25cb /u9875/u6b21/uff1a<font color=/"#e78a29/">", this.Page_Current, "</font>/", this.Page_Count, "/uff0c/u6bcf/u9875/uff1a<font color='#e78a29'>", this.Page_Size, "</font>/u6761" })); builder1.Append("/uff0c/u5171/u8ba1/uff1a<font color='#e78a29'>" + this.Record_Count + "</font>/u6761"); builder1.Append("</td>/n"); builder1.Append("/t/t<td width=/"*/">/n"); builder1.Append("/t/t<div align=/"right/">/u9875/u6570/uff1a/n"); int num1 = 1; if (this.Page_Current > this.PageStep) { num1 = this.Page_Current - this.PageStep; } else { num1 = 1; } int num2 = num1 + (2 * this.PageStep); if ((num1 + (2 * this.PageStep)) > this.Page_Count) { if (((2 * this.PageStep) + 1) > this.Page_Count) { num1 = 1; } else { num1 = this.Page_Count - (2 * this.PageStep); } num2 = this.Page_Count; } for (int num3 = num1; num3 <= num2; num3++) { if (this.Page_Current != num3) { builder1.Append(string.Concat(new object[] { "/t/t<a href=", this.Page_Index, " mce_href=", this.Page_Index, "?page=", num3, ">" })); builder1.Append("[<b>" + num3 + "</b>]</a>"); } else { builder1.Append("/t/t[<font color=#e78a29><b>" + num3 + "</b></font>]"); } } builder1.Append("/t/t</div>/n"); builder1.Append("/t/t</td>/n"); builder1.Append("/t</tr>/n"); builder1.Append("</table>"); output.Write(builder1.ToString()); } } }
相关文章推荐
- CodematicDemo2.0 的PageControl -1
- Codematic2.0中的PageControl部分源代码 -2
- Codematic2.0中的PageControl部分源代码 -3
- CodematicDemo Common部分的源码 PageBase.cs,PageValidate.cs
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- SAF 0.1.0.91 fot .NET 2.0(含基础库和SAF.Data部分源代码)
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- asp.net 2.0中tablecontrol搭配masterpage的小bug
- asp.net 2.0中tablecontrol搭配masterpage的小bug
- Asp.Net 2.0 开发加速之 - Ilungasoft.Helper.Web.UI.MasterPage/Page/UserControl 精装版
- asp.net 2.0中tablecontrol搭配masterpage的小bug
- MapViewControl的源代码(部分)
- Google PageRank的计算源代码
- 安卓项目之淘忆2.0的界面设计部分一
- ZedGraph:一个同时支持WinForm和WebForm的开源图表控件(基于LGPL协议,.NET 2.0 C#源代码)
- RTMPdump(libRTMP) 源代码分析 7: 建立一个流媒体连接 (NetStream部分 2)
- 28-scrollView以及pageControl,NSTimer的基本使用
- Cassandra1.1.0中Compaction部分源代码解析——准备篇
- 稳扎稳打Silverlight(6) - 2.0控件之ScrollViewer, Slider, StackPanel, TabControl, TextBlock
- pageControl 就是广告栏下面的点点