Relegence
asked on
Using a LinkButton in a gridView column
Hello,
I am using a LinkButton in a GridView I am using. In the same column there is also a label.
<asp:TemplateField HeaderText="Computer">
<ItemTemplate>
<label id="lblComputerName" runat="server" style="cursor:hand;">
<%# DataBinder.Eval(Container, "DataItem.computerName")%>
</label>
<asp:Panel CssClass="popupMenu" ID="PopupMenu" runat="server">
<div style="border:1px outset red;padding:2px;width:100p x">
<div><asp:LinkButton ID="lnkStart" Enabled="false" runat="server" OnClick="StartApp" CommandName="Start" Text="Start" /></div>
<div><asp:LinkButton ID="lnkStop" runat="server" OnClick="StopApp" CommandName="Stop" Text="Stop" /></div>
</div>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Computer ID">
<ItemTemplate>
<asp:Label runat="server" ID="lblComputerID" CssClass="linkcursor" Text='<%# DataBinder.Eval(Container, "DataItem.computerID") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
When a linkButton is clicked, I'd like to know on which row it was clicked. Actualy, the information i need is the Value in the ComputerID column in the same row.
How can I get it?
Thank you
I am using a LinkButton in a GridView I am using. In the same column there is also a label.
<asp:TemplateField HeaderText="Computer">
<ItemTemplate>
<label id="lblComputerName" runat="server" style="cursor:hand;">
<%# DataBinder.Eval(Container,
</label>
<asp:Panel CssClass="popupMenu" ID="PopupMenu" runat="server">
<div style="border:1px outset red;padding:2px;width:100p
<div><asp:LinkButton ID="lnkStart" Enabled="false" runat="server" OnClick="StartApp" CommandName="Start" Text="Start" /></div>
<div><asp:LinkButton ID="lnkStop" runat="server" OnClick="StopApp" CommandName="Stop" Text="Stop" /></div>
</div>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Computer ID">
<ItemTemplate>
<asp:Label runat="server" ID="lblComputerID" CssClass="linkcursor" Text='<%# DataBinder.Eval(Container,
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
When a linkButton is clicked, I'd like to know on which row it was clicked. Actualy, the information i need is the Value in the ComputerID column in the same row.
How can I get it?
Thank you
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER