我在asp.net中使用中繼器,並在嘗試調試時不斷收到此錯誤。我已經在這個應用程序中有多箇中繼器,這些中繼器都可以正常工作,沒有任何問題。當我將這個添加到頁面的頂部時,出現此錯誤。當我擺脫數據綁定部分時,錯誤不會顯示。我確實有一個在C#中設置了正確名稱的方法。中繼器上的ItemDataBound上的錯誤
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'rptCert_ItemDataBound' and no extension method 'rptCert_ItemDataBound' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)
源錯誤:
Line 55:
Line 56: <b>Certifications</b><br />
Line 57: <asp:Repeater ID="rptCert" runat="server"
Line 58: onitemdatabound="rptCert_ItemDataBound">
Line 59: <HeaderTemplate>
<asp:Repeater ID="rptCert" runat="server" OnItemDataBound="rptCert_ItemDataBound">
<HeaderTemplate>
<table>
<tr>
<td width="200px"></td>
<td width="30px"></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" ID="lblAcct"></asp:Label>
</td>
<td>
<asp:TextBox runat="server" ID="txtCert"></asp:TextBox>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
你編譯了你的web應用程序嗎?你的方法是否有正確的參數類型? – podiluska 2012-07-30 17:55:50
您是否曾經將頁面背後的default.aspx代碼複製到新文件中? – 2012-07-30 18:31:44
@JoelEtherton這不可能。該代碼位於default.aspx.cs頁面,其中所有其他方法可用,如果我在後端刪除了'onitemdatabound =「rptCert_ItemDataBound」'部分 – agrk12 2012-07-30 18:44:04