title: Are you missing a using directive or an assembly reference. Visual Studio WebDeveloper 2010
body: <p>So I'm having a little trouble trying to figure out what exactly I'm doing wrong here. 
  I'll give you a basic rundown of what I've been doing.</p>
  
  <p>I am creating a Details with and one line of data is a boolean, We were using a CheckBoxField originally but now we are to remove that and use Boolean (True or False changed to Yes or No).
  So I removed the CheckBowField, set the DataField to 'Discontinued', I then use the code;</p>
  
  <pre><code>    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";
      }
      }
  </code></pre>
  
  <p>Into my .aspx.cs page and I come up with this error</p>
  
  <p><strong>Description:</strong> 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. </p>
  
  <p><strong>Compiler Error Message: CS1061:</strong> 'ASP.customformatting_detailsviewtemplatefield_aspx' does not contain a definition for 'DetailsView1_PageIndexChanging' and no extension method 'DetailsView1_PageIndexChanging' accepting a first argument of type 'ASP.customformatting_detailsviewtemplatefield_aspx' could be found (are you missing a using directive or an assembly reference?)</p>
  
  <p><strong>Source Error:</strong></p>
  
  <pre><code>Line 3:  
  Line 4:  &lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server"&gt;
  Line 5:      &lt;asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
  Line 6:          DataKeyNames="ProductID" DataSourceID="ObjectDataSource1" 
  Line 7:          onpageindexchanging="DetailsView1_PageIndexChanging"&gt;
  </code></pre>
  
  <p>And lastly, here is the code for my DetailsView </p>
  
  <pre><code>  &lt;asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
          DataKeyNames="ProductID" DataSourceID="ObjectDataSource1" 
          onpageindexchanging="DetailsView1_PageIndexChanging"&gt;
          &lt;Fields&gt;
              &lt;asp:BoundField DataField="ProductName" HeaderText="Product" SortExpression="ProductName" /&gt;
              &lt;asp:BoundField DataField="CategoryName" HeaderText="Category" ReadOnly="True" SortExpression="CategoryName" /&gt;
              &lt;asp:BoundField DataField="SupplierName" HeaderText="Supplier" ReadOnly="True" SortExpression="SupplierName" /&gt;
              &lt;asp:BoundField DataField="QuantityPerUnit" HeaderText="Qty/Unit" SortExpression="QuantityPerUnit" /&gt;
              &lt;asp:TemplateField HeaderText="Price and Inventory"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Eval("UnitPrice", "{0:C}") %&gt;'&gt;&lt;/asp:Label&gt;
                      &lt;br /&gt;
                      &lt;strong&gt;(In Stock / On Order: &lt;/strong&gt;
                      &lt;asp:Label ID="Label2" runat="server" Text='&lt;%# Eval("UnitsInStock") %&gt;'&gt;&lt;/asp:Label&gt;
                      &lt;strong&gt;/&lt;/strong&gt;
                      &lt;asp:Label ID="Label3" runat="server" Text='&lt;%# Eval("UnitsOnOrder") %&gt;'&gt;
                      &lt;/asp:Label&gt;&lt;strong&gt;)&lt;/strong&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
  
              &lt;asp:BoundField DataField="UnitPrice" HeaderText="Price" SortExpression="UnitPrice"
                  DataFormatString="{0:c}" Visible="False" /&gt;
              &lt;asp:BoundField DataField="UnitsIStock" HeaderText="Units In Stock" SortExpression="UnitsInStock"
                  Visible="False" /&gt;
              &lt;asp:BoundField DataField="UnitsOnOrder" HeaderText="Units On Order" SortExpression="UnitsOnOrder"
                  Visible="False" /&gt;
              &lt;asp:TemplateField HeaderText="Discontinued"&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:Label ID="Label4" runat="server" Text='&lt;%# Bind("Discontinued") %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/ItemTemplate&gt;
                  &lt;EditItemTemplate&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("Discontinued") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;InsertItemTemplate&gt;
                      &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("Discontinued") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/InsertItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
          &lt;/Fields&gt;
      &lt;/asp:DetailsView&gt;
  </code></pre>
  
  <p>Sorry if I have posted way too much code, I'm just not too sure of what you may need to help my figure out my problem. I'm still new to this whole Visual Basic stuff.
  Many thanks in advice!</p>