Listed below are the problems that I encountered when copying files to my solution, clicking on an error message or clicking on "Go to definition" mislead me to determine the cause. Hint - one line above .....!
I reveal the problem And how I finally solved it .
Errors while creating the application:
Error 1 Type "Solution1.Web.yourABC" already defines a member called "Page_Load" with the same parameters | C: \\ trunk \ Solution1.Web \ yourABC.aspx.cs 12 24
Solution 1.Web
Error 2 Type "Solution1.Web.yourABC" already defines a member called "Page_Load" with the same parameters | C: \\ trunk \ Solution1.Web \ GuideABT.aspx.cs 12 24
Solution1.Web
How the problem arose: I copy / paste the .aspx file in the same solution to create a new file. C #: There was an error like below; The worst other misleading errors started affecting the application at runtime:
* Keep in mind that error 1 is NOT an error, it is CORRECT, as this is the source code
Error 1 Type 'Solution1.Web.yourABC' already defines a member called 'Page_Load' with the same parameter types C:\<folderpath>\trunk\Solution1.Web\yourABC.aspx.cs 12 24 Solution1.Web Error 2 Type 'Solution1.Web.yourABC' already defines a member called 'Page_Load' with the same parameter types C:\<folderpath>\trunk\Solution1.Web\GuideABT.aspx.cs 12 24 Solution1.Web
Both "Page_Load" classes are empty, usually they are automatically generated by the Visual Studio Engine.
Solution : Modify the .cs file on the new aspx create / paste page to display the page name after the class name. In this case, "GuideABT.aspx" is the new attached and renamed aspx file:
Correction for error 1: NO CORRECTION NECESSARY, since it is copied from a file. MAKE SURE the file name and the name of the reference to the ARE class are the same in the .cs files:
File name yourABC.aspx, check the .cs extension files:
namespace Solution1.Web { public partial class yourABC : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } }
Bug Fix 2: EDIT file attachment. Correct the CLASS NAME to display the .aspx file name.
File name GuideABT.aspx, check the .cs extension files: ORIGINAL code in .cs
namespace Solution1.Web { public partial class *yourABC* : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } }
FIXED this code in .cs TO
namespace Solution1.Web { public partial class **GuideABT** : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } }
Problem RESOLVED.
Greetings.