I found it very useful so I want to propagate it. I found a need for it while transferring my site from vb.net to C#.
After creating an ASP.NET web form using Microsoft Visual Studio 2005 Team Suite, I renamed the form from it's default name "Default.aspx" to a more user-friendly name "Order.aspx" within MS VS. After adding more code to the C# code-behind page, I discovered the following line: "public partial class _Default"
Being new to the ASP.NET programming language, I changed the "_Default" to "Order" thinking MS VS had failed to rename items within the code it generates. This caused the following error to display at debug/run time: "GetTypeHashCode() : no suitable method found to override"
There were several other errors displayed as well.
The class names must match between the .aspx and .aspx.cs web pages. Here is what the lines in each file should look like:
In the ASPX source file: %@ Page Language="C#" codefile="FormName.aspx.cs" Inherits="FormName_aspx" %
In the ASPX.CS source file: public partial class FormName_aspx : Page
Once I changed the .ASPX file to match the class name in the .ASPX.CS file, the errors were resolved.
26 comments:
I had a similar problem, and this has proven very helpful. Thankyou.
Thank you, this post helped me to fix the error, i just replaced the .cs file with another .cs ...
Bless Technage and Google. I could have been hours trying to sort this out from the manual and help system. Many many thanks.
Thank you so much. I did the same renaming thing and didn't think to check to make sure that VS2005 did proper renaming. Microsoft FTW.
Kudos
this helped me too, I had forgot to change one character...
The problem occurs too, if you do not inherit your partial class from System.Web.UI.Page or a derived class.
The problem appeared to me, when I removed a speciall base class and forgot to put in a simpler one.
Thx, anyhow - your article brought me to look closer to the class.
Thanks, this tip helped a lot
marvellous itried to solve the problem for 2-3 hrs
thnx alot
It was really help full for me; Three days I Googled but this article took 15 minutes !
Saurabh
Bangalore
Thanks a lot!!! It solved my problem!!! I've been thinking so long on this error... @.@
Good job!
Thank you very much for this straight to the point solution that actually worked:D
woo-hoo!!!
Thanks...thah solved the problem.
thank you.. :)
Thanks buddy
hey buddy thnx ..................
It helps me a lot
........................
It was also the case that I was on a System.Web.UI.Page class type and extending a class that was System.Web.UI.UserControl. make sure the class inheritance is correct. Also thanks.
Thanks
thank you
thanx sir...............
it's help me
In my case, this was a real bummer.
All was fine and then boom, it just started throwing errors. Apparently, a different aspx file was referencing my .cs file and since the class names did not match, it was messing up.
Trust me, took me more than an hour to discover the error.
Thanks.... this really helped me
Thanks Yar Thank u very much
thANKU !!!!this really worked
THANK YOU VERY MUCH...
Hi
I am also facing the same issue with the page Name Default.aspx.
class Name is _Default. I have tried this given solution but not worked. please help me to sort
Post a Comment