A
alberthung01
Hi all,
I try to use Container.DataItem() in my DataGrid's ItemTemplate.
Somewhere it works fine.
eg.<input type=checkbox id='cb_select_<%# Container.DataItem("TAG_ID")
%>' value='<%# Container.DataItem("TAG_NAME") %>'>
but somewhere the server returns the expression was wrong.
<asp:ImageButton id="IB_Edit<%# Container.DataItem("TAG_ID") %>"
runat="server" ImageUrl="../Image/edit_image.gif"
CommandName="TO_EDIT"></asp:ImageButton>
or
<asp:ImageButton id="IB_Edit" runat="server" ImageUrl="../Image/
edit_image.gif" OnClientClick="alert('<%# Container.DataItem("TAG_ID")
%>');" CommandName="TO_EDIT"></asp:ImageButton>
Does anyone can tell me what situation i can use this method and what
i can't?
I would appreciate any help on this.
Thank you!
I try to use Container.DataItem() in my DataGrid's ItemTemplate.
Somewhere it works fine.
eg.<input type=checkbox id='cb_select_<%# Container.DataItem("TAG_ID")
%>' value='<%# Container.DataItem("TAG_NAME") %>'>
but somewhere the server returns the expression was wrong.
<asp:ImageButton id="IB_Edit<%# Container.DataItem("TAG_ID") %>"
runat="server" ImageUrl="../Image/edit_image.gif"
CommandName="TO_EDIT"></asp:ImageButton>
or
<asp:ImageButton id="IB_Edit" runat="server" ImageUrl="../Image/
edit_image.gif" OnClientClick="alert('<%# Container.DataItem("TAG_ID")
%>');" CommandName="TO_EDIT"></asp:ImageButton>
Does anyone can tell me what situation i can use this method and what
i can't?
I would appreciate any help on this.
Thank you!