<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<%# ((DataRowView)Container.DataItem)["id"] %>.html" title="<%# ((DataRowView)Container.DataItem)["name"] %>
<%# ((DataRowView)Container.DataItem)["id"]
<%# ((DataRowView)Container.DataItem)["id"] %>
<%# ((DataRowView)Container.DataItem)["name"] %>
<%# ((DataRowView)Container.DataItem)["name"].ToString()%></a></span>
<%# Data.cutStr(((DataRowView)Container.DataItem)["des"].ToString(),45)%>
<%# Left2(((DataRowView)Container.DataItem)["name"].ToString(),2)%>
<%# ((DataRowView)Container.DataItem)["minprice"].ToString()%>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="Repeater2" runat="server">
<ItemTemplate>
<%# ((DataRowView)Container.DataItem)["hotelchain"] %>
<%# ((DataRowView)Container.DataItem)["id"] %>
<%# ((DataRowView)Container.DataItem)["name"]%>
<%# Data.getBrandName(int.Parse(((DataRowView)Container.DataItem)["hotelchain"].ToString()))%>
<%# Data.cutStr(((DataRowView)Container.DataItem)["name"].ToString(),3) %>
<%# ((DataRowView)Container.DataItem)["hotelnumber"].ToString()%>
</ItemTemplate>
</asp:Repeater>
<%# ((DataRowView)Container.DataItem)["id"] %>
<%# ((DataRowView)Container.DataItem)["name"] %>
</ItemTemplate>
</asp:Repeater>
/////////////////////////////////////////////////后台代码
protected void Page_Load(object sender, EventArgs e)
{
this.Repeater1.DataSource = getBrand_type_1(0);
this.Repeater1.ItemDataBound += new RepeaterItemEventHandler(Repeater1_ItemDataBound);
this.Repeater1.DataBind();
rep_allbrandYD.DataSource = getAllBrandYD();
rep_allbrandYD.DataBind();
rep_cityH.DataSource = getCityHL();
rep_cityH.DataBind();
}
void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Repeater Repeater2 = (Repeater)e.Item.FindControl("Repeater2");
Repeater2.DataSource = getBrand_city_dis(int.Parse(((DataRowView)e.Item.DataItem)["id"].ToString()));
Repeater2.DataBind();
}