ÓÃAspNetPagerºÍViewState·Ö±ðʵÏÖasp.net·ÖÒ³
ÒÔϽéÉÜÁ½ÖÖ·ÖÒ³£¬ÓÃAspNetPagerºÍViewState
Ò».AspNetPagerµÄÓ÷¨
1. ¸´ÖÆAspNetPager.dllµ½binĿ¼£¬ÔÚ¹¤¾ßÏä->Ñ¡ÔñÏî->ä¯ÀÀ£¬Ìí¼ÓbinϵÄÒýÓá£
2. ´Ó¹¤¾ßÏäÍϸöAspNetPager£¬¸ÄÈçÏÂÊôÐÔ£º
PageSize--ÿҳÏÔʾµÄ¼Ç¼Êý
CustomInfoHTML--×Ô¶¨ÒåÏÔʾÎı¾£¬Ò»°ãΪ“µÚ%CurrentPageIndex%Ò³ ¹²%PageCount%Ò³”
ShowCustomInfoSection--ÏÔʾµ±Ç°Ò³ºÍ×ÜÒ³ÊýÐÅÏ¢£¬ÖµÎªNever£¬Right£¬Left
AlwaysShow--×ÜÊÇÏÔʾ·ÖÒ³¿Ø¼þ
PageIndexBoxType--Ö¸¶¨Ò³Ë÷Òý¿òµÄÏÔʾÀàÐÍ£¬ÖµÎªÎı¾¿ò£¬ÏÂÀÁбí¿ò
ShowPageIndexBox--Ö¸¶¨Ò³Ë÷Òý¿òµÄÏÔʾ·½Ê½£¬ÖµÎªAlways£¬Never£¬Auto
TextAfterPageIndexBox--Ò³Ë÷Òý¿òºóµÄÎı¾ÄÚÈÝ£¬Ò»°ãΪ“Ò³”
TextBeforePageIndexBox--Ò³Ë÷Òý¿òǰµÄÎı¾ÄÚÈÝ£¬Ò»°ãΪ“תµ½”
ÏÔʾÈçÏÂ
3. ÔÚAspNetPagerµÄPageChangedʼþÖÐдÈçÏ´úÂ룺
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
Databind();
}
private void Databind()
{
PagedDataSource pds = new PagedDataSource();
pds.DataSource = List<T>;
pds.AllowPaging = true;
pds.PageSize = AspNetPager1.PageSize; //AspNetPager1ÊÇID
AspNetPager1.RecordCount = pds.DataSourceCount;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
GridView1.DataSource = pds; //°ó¶¨µ½GridView
GridView1.DataBind();
}
¶þ. ViewState
1.Ëĸö°´Å¥´¥·¢ÒÔÏÂ
Ïà¹ØÎĵµ£º
½ñÌìÑо¿ÁËÒ»ÏÂÔÚasp.netÏÂÓÃC#ÓïÑÔѹËõÎļþ£¬ºÍ½âѹÎļþ£¬ÔÚÍøÉϺÃÁ˺þòÅÕÒµ½Ô´´úÂ룬£¬Õæ²»ÈÝÒ×°¡£¡£¡
ÔÚ ASP.NET ÖÐÓÐÁ½¸öÀࣺDeflateStream ºÍ GZipStream ÓÃÓÚ´¦ÀíѹËõºÍ½âѹËõ£¬ÕâÁ½¸öÀà·Ö±ðʹÓõÄÊÇ DEFLATE ºÍ gzip ѹËõËã·¨£¬ÕâÁ½¸öËã·¨±»Ò»Ð©Ñ¹ËõÈí¼þÖ§³Ö£¬±ÈÈç WinRAR ¾ÍÖ§³Ö gzip¡£ÕâÁ½¸öÀàµÄÃû³Æ¿Õ¼ä¾ùΪ£ ......
Asp.NetÇå¿ÕÒ³ÃæËùÓÐtextboxµÄ¼¸ÖÖ·½·¨×ܽá
ÔÚAsp.NetÖÐÇå¿ÕËùÓÐtextboxÓкü¸ÖÖ·½·¨£¬±¾ÎÄÌṩ¼¸ÖÖ£¬¹©´ó¼Ò²Î¿¼£¡
foreach( Control childControl in this.Controls )
{
if( childControl is TextBox )
((TextBox)childControl).Text = "";
}&n ......
´òÓ¡¾Ö²¿Ò³Ãæ
1. window.print(); ´òÓ¡
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><input class="NOPRINT" type="button" onclick="window ......
1.
ClientScript.RegisterStartupScript(this.GetType(), "js1", "alert('ɾ³ý³É¹¦');window.location='QuerySortList.aspx';", true);
2.
this.cmdSave.Attributes.Add("onclick", "return f_StringCheck()"); ......
public static void Purge(ref List<string>needToPurge)
{
for(int i=0;i<needToPurge.Count-1;i++)
&n ......