그래서 정확히 여기서 내가 잘못하고있는 것이 무엇인지 알아 내려고 약간의 문제가 있습니다. 내가 한 일에 대한 기본 개요를 알려 드리겠습니다.using 지시어 또는 어셈블리 참조가 누락 되었습니까? Visual Studio WebDeveloper 2010
세부 정보를 만들고 있는데 한 줄의 데이터가 부울입니다. 우리는 원래 CheckBoxField를 사용하고 있었지만 이제는이를 제거하고 부울을 사용합니다 (True 또는 False를 Yes 또는 No로 변경). CheckBowField를 제거하고 DataField를 'Discontinued'로 설정 한 다음 코드를 사용합니다. 오류가이 요청을 제공하는 데 필요한 자원의 컴파일하는 동안 발생 : 내 .aspx.cs 페이지에
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class CustomFormatting_DetailsViewTemplateField : System.Web.UI.Page
{
protected string DisplayDiscontinuedAsYESorNO(bool discontinued)
{
if (discontinued)
return "YES";
else
return "NO";
}
}
와 나는이 오류
설명과 함께 제공됩니다. 다음 특정 오류 정보를 검토하고 소스 코드를 적절히 수정하십시오.
컴파일러 오류 메시지 : CS1061 : 'ASP.customformatting_detailsviewtemplatefield_aspx가'볼 수 있습니다 유형 'ASP.customformatting_detailsviewtemplatefield_aspx'의 첫 번째 인수를 받아들이는 'DetailsView1_PageIndexChanging' 'DetailsView1_PageIndexChanging'없이 확장 방법에 대한 정의가 포함되어 있지 않습니다 (당신입니다 ? using 지시문 또는 어셈블리 참조가)
소스 오류 :
Line 3:
Line 4: <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
Line 5: <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
Line 6: DataKeyNames="ProductID" DataSourceID="ObjectDataSource1"
Line 7: onpageindexchanging="DetailsView1_PageIndexChanging">
그리고 마지막으로, 여기에 코드입니다 내 위해 DetailsView에 대한
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
DataKeyNames="ProductID" DataSourceID="ObjectDataSource1"
onpageindexchanging="DetailsView1_PageIndexChanging">
<Fields>
<asp:BoundField DataField="ProductName" HeaderText="Product" SortExpression="ProductName" />
<asp:BoundField DataField="CategoryName" HeaderText="Category" ReadOnly="True" SortExpression="CategoryName" />
<asp:BoundField DataField="SupplierName" HeaderText="Supplier" ReadOnly="True" SortExpression="SupplierName" />
<asp:BoundField DataField="QuantityPerUnit" HeaderText="Qty/Unit" SortExpression="QuantityPerUnit" />
<asp:TemplateField HeaderText="Price and Inventory">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("UnitPrice", "{0:C}") %>'></asp:Label>
<br />
<strong>(In Stock/On Order: </strong>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("UnitsInStock") %>'></asp:Label>
<strong>/</strong>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("UnitsOnOrder") %>'>
</asp:Label><strong>)</strong>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UnitPrice" HeaderText="Price" SortExpression="UnitPrice"
DataFormatString="{0:c}" Visible="False" />
<asp:BoundField DataField="UnitsIStock" HeaderText="Units In Stock" SortExpression="UnitsInStock"
Visible="False" />
<asp:BoundField DataField="UnitsOnOrder" HeaderText="Units On Order" SortExpression="UnitsOnOrder"
Visible="False" />
<asp:TemplateField HeaderText="Discontinued">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Discontinued") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Discontinued") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Discontinued") %>'></asp:TextBox>
</InsertItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
미안 내가 너무 많은 코드를 게시 한 경우, 난 당신이 내 문제를 내 그림을 도울해야 할 수도 있습니다 무엇을 너무 확실하지 않다. 나는이 전체 Visual Basic에 대해 아직 익숙하지 않다. 조언에 많은 감사드립니다!