ÓÃ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.Ëĸö°´Å¥´¥·¢ÒÔÏÂ
Ïà¹ØÎĵµ£º
Web.configÎļþÊÇÒ»¸ö±ê×¼µÄXMLÎĵµ£¬ËùÓеÄÅäÖÃÐÅÏ¢¶¼Î»ÓÚ<configuration>±ê¼ÇÄÚ¡£<system.web>±ê¼ÇÄÚÔò°üº¬Á˺ËÐÄASP.NETÅäÖÃÉèÖá£Óû§¿ÉÒÔÔÚVisual Studio.NETÖдò¿ªWeb.configÀ´²é¿´ºÍ±à¼ËüµÄÄÚÈÝ£¬Õâ¸öÎļþÖаüº¬ÁË´óÁ¿µÄ×¢ÊÍÐÅÏ¢£¬Óû§¿ÉÒÔ²ÎÕÕѧϰ¡£ÏÂÃæ½éÉܼ¸¸ö³£Óõıê¼Ç¡£
1. <appSettings> ......
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 ......
¹ØÓÚÊý¾Ý´¦ÀíÏà¹ØµÄÓÅ»¯
Ò»¡¢ SqlDataReadºÍDatasetµÄÑ¡Ôñ
SqldatareadÓŵ㣺¶ÁÈ¡Êý¾Ý·Ç³£¿ì¡£Èç¹û¶Ô·µ»ØµÄÊý¾Ý²»Ðè×ö´óÁ¿´¦ÀíµÄÇé¿öÏ£ ......
ÕâÀïÎÒֻժȡÁËÔÎĵÄCodeÒÔ¹©Ç±ÐÄÑо¿.using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data.SqlClient;
using System.Web.Security;
using System.Data;
public ......