I have an Employee class object that I am calling from my “Login.aspx” page’s btnContinue_Click event. I am not able to see any of the properties in the intellisense. The Employee.cs file is in the same project as the web application. What confuses me is that the aspx.cs recognizes Employee oEmp = new Employee(); perfectly well.
What am I doing wrong in the code below?
Here is my code:
employee.cs
public class Employee
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string DateOfBirth { get; set; }
public string EMailAddress { get; set; }
public string PhoneNumber { get; set; }
public string CorpID { get; set; }
public string SignOn { get; set; }
public string Password { get; set; }
}
Login.aspx.cs
protected void btnEmployeeLogin_Click(object sender, EventArgs e)
{
try
{
if (LogInValidated())
{
Employee oEmp = new Employee();
//oEmp.
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
It sounds like Visual Studios thinks oEmp is a control on your .aspx page and not a type of your
Employeeclass. Have you double checked your .aspx page to make sure you don’t have a control with itsID="oEmp"andrunat="server"?Or are you sure you don’t have an
Employee.ascxfile in your solution?