Loop through Datalist and get values of non-control items( cell values?) on button click
for (int i开发者_如何学Python = 0; i < datalist1.Items.Count; i++) { datalist1.Items[i]. } Name: '<%#Eval("ElementName")%>' wanna access elementname... by looping through datalist on button click event... button is not on datalist
If i understand your correctly I dont think this is possible, why not just replace it with say a literal, eg
<asp:Literal ID="litFoo" runat="server" Text='<%# Eval("ElementName") %>' />
Then
foreach (DataListItem dli in DataList1.Items)
    {
        if (dli.ItemType == ListItemType.Item || dli.ItemType == ListItemType.AlternatingItem)
        {
            Literal foo = dli.FindControl("litFoo") as Literal;
            //Or, get the text
            string text = ((Literal)dli.FindControl("litFoo")).Text;
        }
    }
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论