How To get objects of MetadataType in other class where we create their type cast
-
sexta-feira, 9 de março de 2012 13:48
public class EmployeeMetaData
[MetadataType(typeof(EmployeeMetaData))]
{
public string _EmpId;
[Required(ErrorMessage = "Enter EmployeeId.")]
[StringLength(5, ErrorMessage = "EmpId Is Not More Then 5 Characters.")]
public string EmpId
{
get
{
return _EmpId;
}
set
{
_EmpId = value;
}
}
}
public class Employee
{
}Default.aspx
protected void Page_Load(object sender, EventArgs e)
{
try
{
Employee objEmployee = new Employee();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
} Here I want to get all properties of Employee Class. How can I?- Movido Esther FanMicrosoft Employee, Moderator segunda-feira, 23 de abril de 2012 01:07 (From:Visual Studio Class Designer)
Todas as Respostas
-
segunda-feira, 12 de março de 2012 08:12
Hi
You need to NEW a instance of this class and use Instace.propertyname to get the property.
by the way, C# in general forum can be more suitable for your issue: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/threads
No code, No fact.

