title: CS1061: (are you missing a using directive or an assembly reference?
body: <p>I am getting this error </p>
  
  <blockquote>
    <p>CS1061:'ASP.dashboard_aspx' does not contain a definition for 'Button6_Click' and no extension method 'Button6_Click' accepting a first argument of type 'ASP.dashboard_aspx' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>When I run it on my development PC it works fine, however when I uploaded on the server it gives this error.</p>
  
  <p>Source Error:</p>
  
  <pre><code>Line 252:
  Line 253:                &lt;/td&gt;&lt;td&gt;
  Line 254:&lt;asp:Button ID="Button3" runat="server" BackColor="#FF9933"     ForeColor="White"   Height="30px" Text="Search" Width="129px" OnClick="Button3_Click" Visible="False" /&gt;
  Line 255:                &lt;/td&gt;
  Line 256:            &lt;/tr&gt;
  </code></pre>
  
  <p>My CS file :</p>
  
  <pre><code>&lt;asp:Button ID="Button3" runat="server" BackColor="#FF9933" Font-Size="Large" ForeColor="White" Height="30px" OnClick="Button3_Click" Text="Search" Visible="False" Width="200px" /&gt;
  </code></pre>
  
  <p>Code Behind :</p>
  
  <pre><code>protected void Button3_Click(object sender, EventArgs e)
      {
          conn = new SqlConnection(strcon);
          conn.Open();
          DataTable dt = new DataTable();
          cmd = new SqlCommand("select * from AssignedProject  where under=@Projectid", conn);
          cmd.Parameters.AddWithValue("@Projectid", DropDownList2.Text);
          da = new SqlDataAdapter(cmd);
          da.Fill(dt);
          if (dt.Rows.Count &gt; 0)
          {
              Label16.Text = "View FTEs Details";
              GridView5.Visible = true;
              GridView2.Visible = false;
              GridView5.DataSource = dt;
              GridView5.DataBind();
  
          }
          else
          {
              Label16.Text = " On Going Project";
              loadGV();
          }
          conn.Close();
      }
  </code></pre>
  
  <p>I have tried to :
  1. Clean and Rebuild
  2. Recreate the button and event
  3. Researched and they said to add Inherit tag at &lt;@Page its already there.
  Nothing seems to be working . It confuses as it was running a day before on the server too. Just added this button and dropdownlist since then its not working.</p>
  
  <p>Please let me know If I am missing anything.
  Thanks</p>