• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3438
  • Last Modified:

Type 'login' already defines a member called 'Page_Load' with the same parameter types

I get this error, and doesnt compile.. anybody get that error before?
0
1jaws
Asked:
1jaws
3 Solutions
 
eguilhermeCommented:
do you have 2 Page_load methods in the login page ?

if you remove the one that isnt used
0
 
1jawsAuthor Commented:
I really dont, I have one page load..
protected void Page_Load(object sender, EventArgs e)
    {
}
0
 
guru_samiCommented:
can you share your login page class name...may be try changing it to login1 and also change inherits of your login page to login1 or create a new page....
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
VenabiliCommented:
Can you post your page?
any includes or something like this that will lead to two Page_Loads?
0
 
VenabiliCommented:
what I am thinking is that you have an embedded page and you have this defined there -- while having it also in the page where you embed it into.
0
 
1jawsAuthor Commented:
Just relaize something though.. If you see below codes, logout page is uses login stuff.. inherets and uses class too.. I sthat correct or not? maybe thats why?
I have this for login page
<%@ Page Language="C#" MasterPageFile="~/mymaster.master" AutoEventWireup="True"
    CodeBehind="login.aspx.cs" Trace="false" Inherits="login"  %>
public partial class login : System.Web.UI.Page
{
       protected void Page_Load(object sender, EventArgs e)
    {

on logout page.. I have this..

<%@ Page Language="C#" MasterPageFile="~/unsecure.master" AutoEventWireup="true" CodeFile="logout.aspx.cs" Inherits="login"
   %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  </asp:Content>

public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FormsAuthentication.SignOut();
        Session.Abandon();
        Response.Redirect("default.aspx");
    }


}
0
 
VenabiliCommented:
Why don't you rename
public partial class login : System.Web.UI.Page
to
public partial class logout : System.Web.UI.Page

on the logout page?
0
 
1jawsAuthor Commented:
by mistake, that was it.. thank you all..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now