I remember that people started discussing the issue of table sorting in the classic forum early in the morning. After so many years, the solutions to this problem have emerged one after another.
It can be implemented using scripts, HTC, XML + XSL, and so on, but the efficiency is different.
I learned this part when I was learning. Net today. By the way, I will review and summarize the previous knowledge discussed with you.
1. CSS + HTC (HTML component)
Microsoft's method is simple, and it has been quite popular in the Classic. To download the components prepared by Dave Massy, you only need to add behavior: URL (XXX. HTC.
However, the disadvantage of this method is that it needs to run on the server. It does not work if it runs directly on the hard disk. In addition, browsers later than ie5 are required. other browsers such as FF are not supported.
Demo: http://msdn.microsoft.com/library/en-us/dndude/html/Qual.asp
Official Address:
Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dndude/html/dude07232001.asp
2. Script Method
This is one of the most widely used methods. Like the table sorting implemented by a http://bt1.btchina.net with a script. The script source file for table sorting in btchina uses Erik Arvidsson (webfx)ProgramIt is called sortable table. The official website has powerful technical support. Visit http://webfx.eae.net/dhtml/tablesort/tablesort.htmlthis program has a relatively high efficiency.
Demo: http://webfx.eae.net/dhtml/sortabletable/demo.html
Official Address: http://webfx.eae.net/dhtml/tablesort/tablesort.html
3. windy_sk (wind2000) scriptCode.
The old master is definitely a classic master, and there are countless waves in the Classic. The earliest learning is his code. original post:
Http://www.blueidea.com/bbs/NewsDetail.asp? Id = 697036
4. There are also some codes of professional experts, which will be summarized later.
There is also the code that cainiao SIPO uses. Net to do... (don't laugh)
The core code is:
If viewstate ("sortexp") is nothing then
Viewstate ("sortexp") = E. sortexpression. tostring
Elseif viewstate ("sortexp") = E. sortexpression. tostring then
Viewstate ("sortexp") + = "DESC"
Else
Viewstate ("sortexp") = E. sortexpression. tostring
End if
Thank you for your help! Asp.net Code finally put on, Demonstration: http://www.dc9.cn/c/webform1.aspx
Thank you... a javascript control from alicloud.