hi,
i wish to know how to get the value of the label control which is specified inside the datalist.
already i try like this
Label lbl = (Label)DataList1.FindControl("lableName");
but i didn't get the correct result.can anyone help me please
Loading
Suthish NairPosted Mar 7, 2011, 2:14 PM
Suthish NairPosted Mar 4, 2011, 3:26 AM
karthi vimalaPosted Mar 4, 2011, 3:13 AM
ya,i go through it,but in that reference i didn't understand where we can get the value of the label.
but i can write the codings with in the itemcommand i got the error in
APP_Web_filename like },] is expected.
Suthish NairPosted Mar 4, 2011, 2:47 AM
karthi vimalaPosted Mar 4, 2011, 2:22 AM
When i used like this i got an error object reference not set to an instance of an object error will occur.
how can i solve this
Suthish NairPosted Mar 3, 2011, 1:45 PM
Raja KrishnamurthyPosted Mar 3, 2011, 10:08 AM
Label lbl = (Label)e.Item.FindControl("lableName"); in Itemcommand. I think DataList1.FindControl("lableName") won't work since there could be multiple controls with the same name.
HTH.
Rajesh SPosted Mar 3, 2011, 9:17 AM
i think it may help you
string str=((Label)DataList1.FindControl("lableName")).Text;
here you should check you have given correct labelid.
VulpesPosted Mar 3, 2011, 9:01 AM
Are you sure you're using the correct ID for the label?