我真的很困惑。浪费了一整天的时间,但仍然无法修复。我制作了一个(Repeater.ascx)web 用户控件(里面有Repeater),然后像这样将它拖到aspx页面(Info.aspx)上。
<uc1:Repeater runat="server" ID="Repeater" />
这是用户控制代码。
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Repeater.ascx.cs" Inherits="DBG.Website.Billing.Repeater" %>
<asp:Repeater ID="repeaterInvoicesPaid" OnItemCommand="ClientNameClicked" runat="server">
<HeaderTemplate>
<table id="PaidInvoicesTable" cellspacing="0" cellpadding="0" style="width: 100%; font-size: 11px; border-right-width: 0; border-bottom-width: 0;"
class="dxgvControl grid dxgvTable">
<thead>
<tr>
<td style="width: 150px;" class="dxgvHeader">Invoice #
</td>
<td style="width: 150px;" class="dxgvHeader">Client Name
</td>
<td style="width: 150px;" class="dxgvHeader">Invoice Date
</td>
<td style="width: 150px;" class="dxgvHeader">Due Date
</td>
<td style="width: 150px;" class="dxgvHeader">Total
</td>
<td style="width: 150px;" class="dxgvHeader">Payment Method
</td>
<td style="width: 150px;" class="dxgvHeader">Status
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr class="dxgvDataRow">
<td class="dxgv">
<asp:Label ID="lblInvoiceID" Text='<%#Eval("InvoiceID")%>' runat="server" />
</td>
<td class="dxgv">
<asp:LinkButton ID="btnClientName" CommandName="NameClicked" Text='<%#Eval("ClientName")%>' CommandArgument='<%#Eval("InvoiceReapterCustomerID") %>' runat="server"/>
</td>
<td class="dxgv">
<asp:Label ID="lblAddedDate" Text='<%#Eval("AddedDateAndTime")%>' runat="server" />
</td>
<td class="dxgv">
<asp:Label ID="lblCloseDate" Text='<%#Eval("CloseDateOnly") %>' runat="server" />
</td>
<td class="dxgv">
<asp:Label ID="lblRecurringCharge" Text='<%#Eval("RecurringCharge") %>' runat="server" />
</td>
<td class="dxgv">
<asp:Label ID="lblPaymentMethodID" Text='<%#Eval("PaymentMethodIDInvoices")%>' runat="server" />
</td>
<td class="dxgv">
<asp:Label ID="lblStatus" ForeColor="Green" Text=' <%#Eval("StatusType") %>' runat="server" />
</td>
<td class="dxgv">
<asp:Label ID="lblCustomerid" Visible="false" Text=' <%#Eval("InvoiceReapterCustomerID") %>' runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
现在我的问题是我想在 info.cs 文件中绑定 Web 用户控件的转发器,但我不知道如何在 info.cs 上获取用户控件和转发器 ID 并绑定它。
注意:我需要将转发器与从 info.cs 的方法返回的数据源(列表)绑定。
请帮忙 。谢谢你。