asp.net - How to set session variable for Eval values for multiple record in database -


< asp:lable runat="server" id="emailid" text='<%#eval("email") %>' height="20px"  width="150px" borderstyle="none" font-bold="true"></asp:label>  <%# session["session_taskcode"] = databinder.eval(container.dataitem, "email")%> 

i getting value of email through session["session_taskcode"] variable in .cs file. problem have multiple records in gridview. so, when wanted values email particular records, session["session_taskcode"] variable takes values of email of last record only.

so, how should take values of email different records in session variable?

hi use rowdatabound event of grid take emails. can use list store emails. ad list session.

//global declaration list<string> emaillist= new list<string>; //rowdatabound event label lblemail= e.finfcontrol("lblemail") lable; emaillist.add(lblemail.text); session["email"]=emaillist; 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -