'_Default' does not contain a definition for (Error 46)

Actual error: Error      46      '_Default' does not contain a definition for 'RdoDomains2Reserve1' and no extension method 'RdoDomains2Reserve1' accepting a first argument of type '_Default' could be found (are you missing a using directive or an assembly reference?)      C:\Documents and Settings\Administrator.LOVEPC\My Documents\Visual Studio 2008\WebSites\MythicForm\Newweb.aspx.cs      160      31      C:\...\MythicForm\


I have been using Visual Studio for years. I am baffled by whats going on. 'RdoDomains2Reserve1 DOES EXIST in Newweb.aspx. The funny part is that the other 100 definitions are not a problem including 'RdoDomains2Reserve2' 'RdoDomains2Reserve3' 'RdoDomains2Reserve4'. Only 'RdoDomains2Reserve1' is a problem, and get this>> If I upload to website form loads with no errors. (yes I restarted my machine)

Anyways here's the code blocks. Top of Newweb.aspx:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Newweb.aspx.cs" Inherits="_Default" %>



Where RdoDomains2Reserve1 is defined:

1. <asp:TextBox runat="server" id="RdoDomains2Reserve1" class="formbox" onchange="searchSuggest();" type="text" /><span class="tip">.com</span>
<br />
2.<asp:TextBox ID="RdoDomains2Reserve2" runat="server" CssClass="formbox"></asp:TextBox>
                                    <br />
3.<asp:TextBox ID="RdoDomains2Reserve3" runat="server" CssClass="formbox"></asp:TextBox>
                                    <br />
 4.<asp:TextBox ID="RdoDomains2Reserve4" runat="server" CssClass="formbox"></asp:TextBox>




Now in Newweb.aspx.cs:

string Domain1 = this.RdoDomains2Reserve1.Text.ToString();
string Domain2 = this.RdoDomains2Reserve2.Text.ToString();
string Domain3 = this.RdoDomains2Reserve3.Text.ToString();
string Domain4 = this.RdoDomains2Reserve4.Text.ToString();



P.S. I also tried rebuilding/debugging with "onchange="searchSuggest();" type="text" out of the RdoDomains2Reserve1 asp:TextBox tag.
igotstehsolutionAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

Have you tried renaming the _Default name in the source and code behind, let say to Home for example (Inherits="Home" and code behind -> "public partial class Home" and then Rebuild?


0
igotstehsolutionAuthor Commented:
Top of Newweb.aspx.cs:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page
{
0
igotstehsolutionAuthor Commented:
All other definitions works with no problem. It is only 1 out of a whole bunch. I only started working on it again recently, you can see it working at this URL:  

http://www.mythicmarketingonline.com/mmo/test2/Newweb.aspx


I just can't test on local machine because it won't build without errors.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Alfred A.Commented:
Hi,

What I meant is to change "_Default" to any name that you want if both Source (HTML) and Code-Behind and then Rebuild.  I encountered something similar in the past.  That is why I was suggesting this.  It is a bit silly but sometimes this things do happen unfortunately. :-)  
0
igotstehsolutionAuthor Commented:
Ok  I changed Inherits to test and it looks like this

Newweb.aspx

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Newweb.aspx.cs" Inherits="test" %>

Newwb.aspx.cs :

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Net.Mail;

public partial class test : System.Web.UI.Page



and the errors I got were:

Error      44      Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).      C:\Documents and Settings\Administrator.LOVEPC\My Documents\Visual Studio 2008\WebSites\MythicForm\Newweb.aspx.cs      11      33      C:\...\MythicForm\

Error      45      'ASP.newweb2_aspx.GetTypeHashCode()': no suitable method found to override      c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mythicform\06d27fe5\62143413\App_Web_-lvgecpb.4.cs      5991      

Error      46      'ASP.newweb2_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override      c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mythicform\06d27fe5\62143413\App_Web_-lvgecpb.4.cs      5996      


What the hell is file name  App_Web_-lvgecpb.4.cs ???
0
Alfred A.Commented:
Hi,

Also, is RdoDomains2Reserve1 in your aspx.designer.cs?  Is the name of the public partial class still "_Default" in the aspx.designer.cs
0
Alfred A.Commented:
Hi,

OK.  Try to do this, delete all temporary files, and after this, Rebuild.

If this still doesn't work,  try to delete the Debug and Release folders in your obj folders, and then try to rebuild.
0
Alfred A.Commented:
Hi,

Also, the error you got, Error 44, be sure to address the issue of namespaces when linking source and code-behind including designer.cs
0
igotstehsolutionAuthor Commented:
This is about to sound very noobish but here goes.


I have only 2 files.

Newweb.aspx
Newweb.aspx.cs


Newweb.aspx has:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Newweb.aspx.cs" Inherits="test" %>


and

<asp:TextBox runat="server" id="RdoDomains2Reserve1" class="formbox" onchange="searchSuggest();" type="text" /><span class="tip">.com</span>
<br />




While Newweb.aspx.cs has:


using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Net.Mail;

public partial class test : System.Web.UI.Page



and


string Domain1 = this.RdoDomains2Reserve1.Text.ToString();




Does that answer your question or am I supposed to have a Newweb.aspx.designer.cs? because I don't have one of those.


0
Alfred A.Commented:
Hi,

OK.  Have you tried cleaning up your temp files and rebuild?  Are you still getting those errors that you mentioned?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
igotstehsolutionAuthor Commented:
OK found the solution.

In the error logs it was always referencing to Newweb.aspx and Newweb.asp.cs.


As soon as I excluded Newweb2.aspx and Newweb2.aspx.cs it built and ran with no problems.

Errors should have said something about Newweb2.aspx if it was the problem.... I triple checked all the errors nothing about Newweb2.aspx.

In any case, problem solved!
0
igotstehsolutionAuthor Commented:
fast
0
Alfred A.Commented:
Hi,

That is good to hear then. Sometimes,  patience is needed to solve problems. :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.