I have a gridview that has a column that has a Hyperlink control as wellas a LinkButton control. As such:
<asp:TemplateField HeaderText="Actions">
<ItemTemplate>
<asp:HyperLink ID="linkEdit" runat="server" NavigateUrl="~/shipment.aspx">Edit</asp:HyperLink> |
<asp:LinkButton ID="linkSend" runat="server">Send</asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="76" HorizontalAlign="Center" />
</asp:TemplateField>
Each row will have an "Actions" column that looks like this: Edit | Send
How do I set the NavigateUrl property of the Hyperlink in each row to include a value from the first column of the row?
Example: NavigateUrl="~/shipment.aspx?edit=VALUE_FROM_COLUMN_0_OF CURRENT_ROW"
Try
<asp:HyperLink ID="linkEdit" runat="server"
NavigateUrl='<%# "~/shipment.aspx?edit=" + Eval("IdField")" %>' >Edit</asp:HyperLink>