html代码如下:
<ItemTemplate>
<FONT size="2">
书籍ID:
<asp:Label id="LbBookId" runat="server">
<%#DataBinder.Eval(Container.DataItem,"BookId"," {0}")%></asp:Label>
<asp:LinkButton id="LBtnViewBookDetail" runat="server" CommandName="View">查看详情</asp:LinkButton></FONT>
</ItemTemplate>
view命令处理服务器端代码如下:
Label temp=(Label)e.Item.FindControl("LbBookId");
string value=temp.text;
pageload中判断了IsPostBack,不是IsPostBack的问题
但是总是取出来的都是空值,是怎么回事呢
<ItemTemplate>
<FONT size="2">
书籍ID:
<asp:Label id="LbBookId" runat="server">
<%#DataBinder.Eval(Container.DataItem,"BookId"," {0}")%></asp:Label>
<asp:LinkButton id="LBtnViewBookDetail" runat="server" CommandName="View">查看详情</asp:LinkButton></FONT>
</ItemTemplate>
view命令处理服务器端代码如下:
Label temp=(Label)e.Item.FindControl("LbBookId");
string value=temp.text;
pageload中判断了IsPostBack,不是IsPostBack的问题
但是总是取出来的都是空值,是怎么回事呢
或者把<%# 换成 <% 试试