Hello..
i have one datalist.i use label1 in my .net design page index.aspx i write the code in index.aspx.cs page.
string name = Label1.Text.Trim();
Session["name"] = name;
but Label1.Text error show "The name 'Label1' does not exits in the current context"
This stupid problem lost my 2 day.
Please solution provide me..
7 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Rahul PrajapatPosted Sep 1, 2015, 7:54 AM
{
string name = ((Label)(DataList1.Items[e.Item.ItemIndex].FindControl("Label1"))).Text.Trim();
Session["name"] = name;
}
Khan Abrar AhmedPosted Sep 1, 2015, 7:50 AM
Raja TPosted Sep 1, 2015, 3:13 AM
Manas MohapatraPosted Sep 1, 2015, 3:13 AM
Ranjit PowarPosted Sep 1, 2015, 3:08 AM
Prashant MalavPosted Sep 1, 2015, 3:02 AM
Manas MohapatraPosted Sep 1, 2015, 2:35 AM