Very Urgent....How to get the text value of Label placed in a DataList
-
Hi, I have a label control which is placed in DataList. The value of the label bounds using DataBinder.Eval...method. Now in the code of its ItemCommand i want to retrieve the value of the label. I know the process that used in VB.NET but dont know how it will be done in C#.. I did... string str=Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)).ToString(); But this line does not gets its Text value... Any one can help me plsss....... KHATRI
-
Hi, I have a label control which is placed in DataList. The value of the label bounds using DataBinder.Eval...method. Now in the code of its ItemCommand i want to retrieve the value of the label. I know the process that used in VB.NET but dont know how it will be done in C#.. I did... string str=Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)).ToString(); But this line does not gets its Text value... Any one can help me plsss....... KHATRI
-
Hi, I have a label control which is placed in DataList. The value of the label bounds using DataBinder.Eval...method. Now in the code of its ItemCommand i want to retrieve the value of the label. I know the process that used in VB.NET but dont know how it will be done in C#.. I did... string str=Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)).ToString(); But this line does not gets its Text value... Any one can help me plsss....... KHATRI
the line of code Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)) will return specific object with the specified system.type(Label) not the text of label so u can replace string str with Label object and then use it to get text so u can use this Label lbl=Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)); string requiredtext=lbl.Text i hope this will help
-
the line of code Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)) will return specific object with the specified system.type(Label) not the text of label so u can replace string str with Label object and then use it to get text so u can use this Label lbl=Convert.ChangeType(e.item.FindControl("lblName"),typeof(Label)); string requiredtext=lbl.Text i hope this will help
Well Mr kitokatakito I tried the way u told me but it doesnt work.. By the way now its working Thanks Apurva your way works... KHATRI
-
Well Mr kitokatakito I tried the way u told me but it doesnt work.. By the way now its working Thanks Apurva your way works... KHATRI