Last post Jul 03, 2008 10:32 PM by uwillrememberme
May 07, 2008 07:22 AM|uwillrememberme|LINK
I have just migrated a fairly large asp.net 1.1 application to 3.5. During the conversion process, everything seemed to go fine.
If the .aspx page I'm trying to view in a browser does not contain an asp:button, it loads fine and everything works A OK.
When I attempt to load any .aspx page that contains an asp:button, we get the following error:
Compiler Error Message:
CS1061: 'ASP.search_searchadvanced_aspx' does not contain a definition for 'btnSearch_Click' and no extension method 'btnSearch_Click' accepting a first argument of type 'ASP.search_searchadvanced_aspx' could be found (are you missing a using directive
or an assembly reference?)
Ok, now...when I go into the web form and remove this: onclick="btnSearch_Click" --- then the page works fine.
This is the same case for other controls that make posts backs.
Can someone point me to information that will help me solve this problem?
Does anyone have any suggestions on how to fix this?
This app has many many buttons and controls that post back!
Thanks in advance.
May 12, 2008 05:46 AM|Thomas Sun – MSFT|LINK
can you compile your application successfully?
Firstly, please make sure that the Inherits value of page directive matches the codebehind class name in Page directive.
Please make sure that this event is in the code behind.
I hope this helps.
Jun 28, 2008 10:21 AM|vishalupathak|LINK
Have you used migration tool which comes with visual studio 2008, for migration?
I think this problem is due to conversion of code behind class to partial class. When you try to migrate 1.1 codes to 3.5, using above migration tool, it asks for conversion of class definition to partial class. While doing so, it creates new file for
each class as <your code behind file name>.designer.<cs/vb>. It stores control definitions in this file, and other code in original file. But sometimes this tool ignores some control definition, and thus don't add those definition to <your code behind file
name>.designer.<cs/vb> file, this causes above error.
Solutions: 1) While migrating your application using above migration tool, don't allow it to convert your classes to partial (Asked in step 2 of migration).
2) Or if number of missing definitions is small, then you can add them manually, after partial class conversion.
Hope this will help.
Jul 03, 2008 10:32 PM|uwillrememberme|LINK
Thanks for your help.
We ended up going through each file and updating the files.
It took 2 weeks, (which was a bit of a bummer) but the problem is solved.