c# - Label.property reference -


i inserted label (called label1) in "table cell" in turn inserted datalist.

why in situation, can't use, example, label1.text inside page_load method, however when insert label outside datalist, reference label1 works perfectly?

is there workaround this, need label in table cell described , able modify caption (.text property) code-behind file, plan assign value of stored procedure. hello , thank in advance.

if control inside datalist, repeated each item in list. consequently, doesn't make sense refer control outside of datalist, asp.net not know instance refer - , if there no data, there won't instances!

you can access label given item in datalist, however:

datalistitem item = datalist.items[0]; // or whichever item want label label1 = (label)item.findcontrol("label1"); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -