public void ToggleSort()
{
SortParm srt = this.ParseSort();
if (!String.IsNullOrEmpty(this.SortByNew)) {
if (srt.SortField.ToLowerInvariant() == this.SortByNew.ToLowerInvariant()) {
if (srt.SortDirection.EndsWith("ASC")) {
this.OrderBy = String.Format("{0} DESC", this.SortByNew);
} else {
this.OrderBy = String.Format("{0} ASC", this.SortByNew);
}
} else {
this.OrderBy = String.Format("{0} ASC", this.SortByNew);
this.PageNumber = 1;
}
}
this.SortByNew = String.Empty;
}