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

VulpesRank #55 · 29.2K reputationPosted Mar 3, 2011, 4:01 AM EST
Are you sure you're using the correct ID for the label?
Rajesh S108 reputationPosted Mar 3, 2011, 4:17 AM EST
i think it may help you
string str=((Label)DataList1.FindControl("lableName")).Text;
here you should check you have given correct labelid.
Raja KrishnamurthyRank #3,615 · 403 reputationPosted Mar 3, 2011, 5:08 AM EST
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.
Suthish NairRank #92 · 22.8K reputationPosted Mar 3, 2011, 8:45 AM EST
karthi vimala38 reputationPosted Mar 3, 2011, 9:22 PM EST
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 NairRank #92 · 22.8K reputationPosted Mar 3, 2011, 9:47 PM EST
karthi vimala38 reputationPosted Mar 3, 2011, 10:13 PM EST
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 NairRank #92 · 22.8K reputationPosted Mar 3, 2011, 10:26 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Mar 7, 2011, 9:14 AM EST