Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with Line Command and Page in ASP.NET

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to deal with line commands and paging in ASP.NET. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

1. Line command processing

(1) background code: operation line

/ / if it comes from the function operation in the html response

If (e.CommandNameplate = "addAge") {

/ / get the line number

Int index= ((ListViewDataItem) e.Item) DispalyIndex

/ / get the primary key value of the current operation line

/ / DataKeys stores all the ID and fetches the index ID

Guid id= (Guid) ListView1.DataKeys [index] .value

Table Adapter adapter=new Table Adapter ()

Adpter. Custom database function addAge

/ / data binding

ListView.DataBing ()

}

(2) sort

CommandName= "Sort"

CommandArgument= "ID"

Internal sorting, low efficiency

2. DataPager paging

PageControlID: which ListView is paged

Advanced pagination:

Query subquery

Select* from

(Select id,name,age,row_number () over (order by id) rownum from T_Users) t

Where t.rownum > 11and t.rownum@startRowIndex and t.rowRow

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report