S
Sharon
Hi Community
I am using a Datalist control on my aspx page with C#. In my
ItemDataBound and ItemCommand
events I am trying to put first column of the fist row into a variable. The
column is the ID#/column and it's <td> tag id is id="incDL" I check what
value is in the variable by showing it in a label control but it is always 0.
The problem is that I know that the value in that column is 38 in the
datasource table for that first row in that first column. The field is the
ID# and I am accessing it thru its id property in the <td> tag. Can anyone
tell me how to get the value (ID#) from the Datalist into the variable? The
following is how the Datalist looks:
<div id="dent">
<div id="denthdr"></div>
<div id="Rptr">
<aspataList ID="incDL"
RepeatDirection="Vertical"
RepeatLayout="Table"
runat="server" onitemdatabound="incDL_ItemDataBound"
onitemcommand="incDL_ItemCommand"
onitemcreated="incDL_ItemCreated"
onselectedindexchanged="incDL_SelectedIndexChanged" >
<HeaderTemplate>
<table>
<tr>
<td>ID#</td>
<td>Type</td>
<td>Quest</td>
<td>Call</font></td>
<td>Reason</font></td>
<td>PT1</td>
<td>PT2</td>
<td>PT3</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td id="numID"> <%# DataBinder.Eval(Container.DataItem, "ID#")
%></td>
<td id="TypeID"> <%# DataBinder.Eval(Container.DataItem, " Type")
%> </td>
<td id="QuestID"> <%# DataBinder.Eval(Container.DataItem, "Quest")
%> </td>
<td id="callID"> <%# DataBinder.Eval(Container.DataItem, "Call")%>
</td>
<td id="ReasonID" > <%# DataBinder.Eval(Container.DataItem,
"Reason") %> </td>
<td id="PT1ID"> <%# DataBinder.Eval(Container.DataItem, "PT1")%>
</td>
<td id="PT2ID"> <%# DataBinder.Eval(Container.DataItem, "PT2")%>
</td>
<td id="PT3ID"> <%# DataBinder.Eval(Container.DataItem, "PT#")%>
</td>
<td><asp:Button ID="btnSelect" runat="server" Text="Select"
CommandName="select"
onclick="btnSelect_Click" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</aspataList>
</div>
</div>
Thank you in advance
Sharon
I am using a Datalist control on my aspx page with C#. In my
ItemDataBound and ItemCommand
events I am trying to put first column of the fist row into a variable. The
column is the ID#/column and it's <td> tag id is id="incDL" I check what
value is in the variable by showing it in a label control but it is always 0.
The problem is that I know that the value in that column is 38 in the
datasource table for that first row in that first column. The field is the
ID# and I am accessing it thru its id property in the <td> tag. Can anyone
tell me how to get the value (ID#) from the Datalist into the variable? The
following is how the Datalist looks:
<div id="dent">
<div id="denthdr"></div>
<div id="Rptr">
<aspataList ID="incDL"
RepeatDirection="Vertical"
RepeatLayout="Table"
runat="server" onitemdatabound="incDL_ItemDataBound"
onitemcommand="incDL_ItemCommand"
onitemcreated="incDL_ItemCreated"
onselectedindexchanged="incDL_SelectedIndexChanged" >
<HeaderTemplate>
<table>
<tr>
<td>ID#</td>
<td>Type</td>
<td>Quest</td>
<td>Call</font></td>
<td>Reason</font></td>
<td>PT1</td>
<td>PT2</td>
<td>PT3</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td id="numID"> <%# DataBinder.Eval(Container.DataItem, "ID#")
%></td>
<td id="TypeID"> <%# DataBinder.Eval(Container.DataItem, " Type")
%> </td>
<td id="QuestID"> <%# DataBinder.Eval(Container.DataItem, "Quest")
%> </td>
<td id="callID"> <%# DataBinder.Eval(Container.DataItem, "Call")%>
</td>
<td id="ReasonID" > <%# DataBinder.Eval(Container.DataItem,
"Reason") %> </td>
<td id="PT1ID"> <%# DataBinder.Eval(Container.DataItem, "PT1")%>
</td>
<td id="PT2ID"> <%# DataBinder.Eval(Container.DataItem, "PT2")%>
</td>
<td id="PT3ID"> <%# DataBinder.Eval(Container.DataItem, "PT#")%>
</td>
<td><asp:Button ID="btnSelect" runat="server" Text="Select"
CommandName="select"
onclick="btnSelect_Click" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</aspataList>
</div>
</div>
Thank you in advance
Sharon