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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -