This topic is locked

Tip: how to add a 'sort' option to list page

4/8/2004 11:53:22 PM
ASPRunnerPro General questions
Pete M author

Hi All
I was trying to do something else (see other post) by cutting and pasting code, and accidentally added a sort option to my list page. I know next to nothing about asp, but this worked for me, and I thought someone may find it useful to adapt

.

The field sorted on is called 'PropertyName'. I just pasted this code above the main data table. There my be some superfluous code here as well.
<a href="tblProperty_list.asp" onClick="java script:

document.forms.frmAdmin.action.value = 'OrderBy';

document.forms.frmAdmin.orderby.value = '<%=Replace("PropertyName","'","\'")%>';

document.forms.frmAdmin.submit(); return false; "><%=Label("Sort on Property Name")%>

</a>

Sergey Kornilov admin 4/10/2004

Pete,
you can do exactly the same by clicking on the column header on the list page.

Pete M author 4/10/2004

Doh!
Thanks for pointing that out, Sergey
I hadn't realised this was already built-in