頁面**:
[c-sharp]view plain
copy
後台**:
[c-sharp]view plain
copy
///
/// 當前頁索引
///
private
intpager
set}
protected
void
page_load(
object
sender, eventargs e)
} private
void
datasource()
///
///
///
private
void
setenable(pageddatasource obj)
if(obj .islastpage )
} ///
/// 儲存按什麼排序和顯示的頁索引
///
///
///
protected
void
btnname_click(
object
sender, eventargs e)
///
/// 儲存按什麼排序和顯示的頁索引
///
///
///
protected
void
btnid_click(
object
sender, eventargs e)
protected
void
btnprepage_click(
object
sender, eventargs e)
protected
void
btnnextpage_click(
object
sender, eventargs e)
//給頁資料來源賦值
pds.datasource = userstatemamager.getallstatesorderby(viewstate["order"].tostring ());
中的呼叫的方法(原型):
[c-sharp]view plain
copy
public
static
listgetallstatesorderby(
string
orderbyname)
sqldatareader dr = dbhelper.getreader(sql);
while
(dr.read ())
return
us;
}
datalist實現分頁
原檔案test.aspx test.aspx.cs檔案 using system using system.data using system.configuration using system.collections using system.web using system.web.secur...
DataList 控制項分頁操作
aspx 原始檔 page language c codebehind radionj list.aspx.cs autoeventwireup false inherits radio.radio.radionj list cs 原始檔 using system using system.coll...
用DataList分頁讀取資料
using system using system.data using system.configuration using system.web using system.web.security using system.web.ui using system.web.ui.webcontro...