简体   繁体   中英

Member defined more than once

I am new to the whole get and set thing, but this seems pretty straightforward, don't I set something but just calling this.Var = value ?

public LoginView LoginView1 { get; set; }

void Page_Load(Object sender, EventArgs e)
{
    this.LoginView1 = (LoginView)FindControls.FindControlRecursive(Page, "LoginView1"); 
    RadGrid RadGrid3 = (RadGrid)LoginView1.FindControl("RadGrid3");
    RadGrid RadGrid4 = (RadGrid)LoginView1.FindControl("RadGrid4");
    UpdatePanel UpdatePanel1 = (UpdatePanel)LoginView1.FindControl("UpdatePanel1");
    LoadData();
}

My error is saying that LoginView1 is defined more than once. All I want to do is set the global variable on Page Load.

You'll have it on the page itself, which means it is in the designer.cs file too, which means there is indeed a LoginView1 already defined, for the login view you are trying to get.

Call it something else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM