個別のレコードに基づいてフィルタリングしようとしています。次のコードを使用しました
List<BALHotelList> searchresult = (from a in bh
join b in hr on a.HotelCode equals b.hotelCode
orderby a.HotelName
select new BALHotelList
{
HotelCode = a.HotelCode,
ImageURL_Text = a.ImageURL_Text,
HotelName = a.HotelName,
StarRating = a.StarRating,
HotelAddress = a.HotelAddress,
Destination = a.Destination,
Country = a.Country,
HotelInfo = a.HotelInfo,
Latitude = a.Latitude,
Longitude = a.Longitude,
HotelArea=a.HotelArea,
totalPrice = b.totalPrice,
totalPriceSpecified = b.totalPriceSpecified,
totalSalePrice = b.totalSalePrice,
totalSalePriceSpecified = b.totalSalePriceSpecified,
rooms = b.rooms,
boardType = b.boardType
}).ToList();
var uniqueArea =searchresult.Select(m => m.HotelArea).Distinct();
rptHotelArea.DataSource = uniqueArea;
rptHotelArea.DataBind();
しかし、データ ソースで HotelArea が見つかりません。
しかし、デバッグすると、すべての個別の値が表示されますuniqueArea
エラーは次のとおりです。
DataBinding: 'System.String' does not contain a property with the name 'HotelArea'.
編集済み
リピーターHTMLはこちら
<asp:Repeater ID="rptHotelArea" runat="server">
<ItemTemplate>
<div class="sub-part1">
<a href="#"><%#Eval("HotelArea")%></a></div>
</ItemTemplate>
</asp:Repeater>