我正在使用以下代码将分页数据源绑定到转发器控件
protected void Paging()
{
Array q = (Array)Session["q"];
PagedDataSource objPds = new PagedDataSource();
objPds.DataSource = q;
objPds.AllowPaging = true;
objPds.PageSize = Convert.ToInt32(ddlPageNo.SelectedValue);
objPds.CurrentPageIndex = CurrentPage;
lblCurrentPage.Text = "Page: " + (CurrentPage + 1).ToString() + " of "
+ objPds.PageCount.ToString();
// Disable Prev or Next buttons if necessary
cmdPrev.Enabled = !objPds.IsFirstPage;
cmdNext.Enabled = !objPds.IsLastPage;
rptHotels.DataSource = objPds;
rptHotels.DataBind();
}
q
在哪里
getAvailableHotelResponse getres = new getAvailableHotelResponse();
getres = objsoap.getAvailableHotel(apiKey, destinationId, checkIn, checkOut, strCurrencyCode, "UK", false, rooms, f);
List<hotel> hr = new List<hotel>();
hr = getres.availableHotels.ToList();
List<BALHotelList> bh = new List<BALHotelList>();
bh = h.GetHotelListByDestinationId(destinationId);
var q = from a in bh
join b in hr on a.HotelCode equals b.hotelCode
orderby a.HotelName
select new
{
a.HotelCode,
a.ImageURL_Text,
a.HotelName,
a.StarRating,
a.HotelAddress,
a.Destination,
a.Country,
a.HotelInfo,
a.Latitude,
a.Longitude,
b.totalPrice,
b.totalPriceSpecified,
b.totalSalePrice,
b.totalSalePriceSpecified,
b.rooms
};
//rptHotels.DataSource = getres.availableHotels;
Session["q"] = q.ToArray();
现在我想用
想要通过hotelname
or对数组 q 进行排序starRating
。
我没有找到任何类似的方法
q.sort();
或者
q.orderBy(q->hotelName)