建体彩网|中彩网双色球连号|
?
快捷搜索:  as  test  1111  test aNd 8=8  test++aNd+8=8  as++aNd+8=8  as aNd 8=8

澳門新莆京app官網:Jquery+JSon實現的Asp.net無刷新分頁控件

?

控件類代碼:

using System;

using System.Collections.Generic澳門新莆京app官網;

using System.ComponentModel;

using System.Linq;

using System.Text;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Reflection;

using System.IO;

[assembly: WebResource("PageBarJS.js", "application/x-javascript")]

namespace Hawkon.Control {

[DefaultProperty("Text")]

[ToolboxData("")]

public class PageBar : WebControl {

[Bindable(true)]

[Category("Data")]

[DefaultValue("1")]

[Localizable(true)]

public i澳門新莆京app官網nt PageIndex {

get {

return pageIndex;

}

set {

pageIndex = value;

}

}

private int pageIndex;

[Bindable(true)]

[Category("Data")]

[DefaultValue("1")]

[Localizable(true)]

pu澳門新莆京app官網blic int PageCount {

get {

return pag澳門新莆京app官網eCount;

}

set {

pageCount = value;

}

}

private int pageCount;

[Bindable(true)]

[Category("Data")]

[DefaultValue("5")]

[Localizable(true)]

public int DisplayCount {

get {

return displayCount;

}

set {

displayCount = value;

}

}

private int displayCount;

protected override void RenderContents(HtmlTextWriter output) {

string html = "";

html += CreateA(1, "");

int b = 0, e = 0;

if (pageIndexdisplayCount) {

b = 1;

e = displayCount * 2 + 1;

}

else if (pageIndex > pageCount - displayCount) {

b = pageCount - displayCount * 2;

e = pageCount;

}

else {

b = pageIndex - displayCount;

e = pageIndex + displayCount;

}

if (b1) {

html += CreateA(1, "");

}

else

html += CreateA(b - 1, "");

for (int i = b; ie; i++) {

html += CreateA(i, i.ToString());

}

html += CreateA(e + 1, "");

html += CreateA(pageCount, ">>");

// html += string.Format("",

//this.Page.ClientScript.GetWebResourceUrl(typeof(PageBar), "JScript1.js"));

output.Write(html);

}

private string CreateA(int pageIndex, strin澳門新莆京app官網g text) {

if (pageIndex == this.pageIndex) {

return string.Format(""pageA\" title='頁'id =\"{0}\">{1} ", pageIndex, text);

}

return string.Format(""pageA\" title='頁' href=\"#\" id=\"{0}\">{1} ", pageIndex, text);

}

protected override void OnPreRender(EventArgs e) {

base.OnPreRender(e);

string resourceName = "PageBarJS.js";

string url = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), "PageBarJS.js");

string script = "\r\n";

this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), resourceName, script, false);

script = @"";this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ready", script);

}

protected override void Render(HtmlTextWriter writer) {

base.Render(writer);

}

}

}

免責聲明:以上內容源自網絡,版權歸原作者所有,如有侵犯您的原創版權請告知,我們將盡快刪除相關內容。

您可能還會對下面的文章感興趣:

建体彩网
广东十一选五专家预测 127期单双中特 山东群英会任5最大遗漏号码 雷速体育答题测试答案 鼎汇彩票网址 江南高纤股票分析 山东时时彩玩法介绍 微乐贵阳麻将外挂 福彩20选5怎么算中奖 四川金7乐网上开奖查询