请教:为什么取到的是空值?
前台页面html:<asp:DataList ID="dalistfushi" runat="server" RepeatDirection="Horizontal"
onitemcommand="dalistfushi_ItemCommand">
<ItemTemplate>
<table class="style3">
<tr>
<td align="center">
<asp:ImageButton ID="imgfushi" runat="server" Width="162" Height="162" CommandName="showdetailfs"/>
</td>
<tr>
<td align="center">
<asp:Label ID="labwareid" runat="server" Visible="False"><%# Eval("ware_id")%></asp:Label>
</td>
</tr>
</table>
</itemtemplate>
后台代码: protected void dalistfushi_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "showdetailfs")
{
object ob = e.Item.FindControl("labwareid").GetType();
string ware_id = ((Label)e.Item.FindControl("labwareid")).Text.ToString();
string ware_type_id = ((Label)e.Item.FindControl("labwaetpeid")).Text;
}
}
为什么ware_id的值是空的 但是datalist这个控件实际已经取到值了