ravinaik_2002 0 Newbie Poster

Hi.... All Can any one solve this.... i have an application it contain many aspx pages. here i am collecting all controls id's(ex:label1,texbox1,grid1.....etc ) from all page in the application till its working fine.... now i want to collect text property of that contros(ex: label1 have text property StudentId ...etc) how i can do it....

here i have code to collect all controls:

Assembly getAss = Assembly.GetExecutingAssembly();

Type[] Get = getAss.GetTypes();

foreach (Type t in Get)

{

ddCntrl.Items.Clear();

FieldInfo[] myFieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetField); PropertyInfo[] properties = t.GetProperties();

for (int i = 0; i < myFieldInfo.Length; i++)

{

string str = myFieldInfo.Module.ToString();

string strName = myFieldInfo.Name;

Type TypDeclaringType = myFieldInfo.DeclaringType;

Boolean blnIsPublic = myFieldInfo.IsPublic;

MemberTypes mtMemberType = myFieldInfo.MemberType;

Type TypFieldType = myFieldInfo.FieldType;

Boolean blnIsFamily = myFieldInfo.IsFamily;

if (TypFieldType.Name == "Label")

{

ddCntrl.Items.Add(strName);//its collect all controls id's

}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.