次のコードを使用して、ページ化されたデータソースをリピーター コントロールにバインドしています
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
またはで配列 q をソートしたいstarRating
。
次のような方法が見つかりません
q.sort();
また
q.orderBy(q->hotelName)