- <asp:ListView runat="server" ID="lsvClass" DataSourceID="SqlDataSource1">
- <LayoutTemplate>
- <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
- </LayoutTemplate>
- <ItemTemplate>
- <td><%#Eval("ClassName") %></td>
- <td><%#Eval("TicketCount") %></td>
- <td><%#String.Format("{0:0.0}",Eval("HardSeatTotal")) %></td>
- <td><%#String.Format("{0:0.0}",Eval("AdvanceTotal")) %></td></tr><tr>
- </ItemTemplate>
- </asp:ListView>
- <asp:SqlDataSource ID="SqlDataSource1" runat="server"
- ConnectionString="<%contentnbsp;ConnectionStrings:TrainConnectionString %>"
- SelectCommand="SELECT * FROM [V_DetailOrderListForClass]"></asp:SqlDataSource>
498)this.width=498;'' onmousewheel = ''javascript:return big(this)'' height="231" alt="" src="/uploadfile/201301/5/87151523518.png" width="640" border="0" />
控件的cs页面代码:
- namespace Website.Controls
- {
- public partial class ListViewClass : System.Web.UI.UserControl
- {
- private string academeID;
- public string AcademeID
- {
- set { academeID = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- SqlDataSource1.SelectCommand = "SELECT * From [V_DetailOrderListForClass] where AcademeID=@AcademeID";
- SqlDataSource1.SelectParameters.Add("AcademeID",System.TypeCode.Int32, academeID);
- lsvClass.DataBind();
- }
- }
- }
这