Hello,
In webapp I have <asp:GridView.. and inside it column:
<asp:TemplateField HeaderText="PS" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<%#(int)Eval("PaymentStatusId") == int)PaymentStatusEnum.Paid ? "P" :
(int)Eval("PaymentStatusId") == (int)PaymentStatusEnum.PendingOK ? "PINV" : "H"%>
//code I want to add
</ItemTemplate>
</asp:TemplateField>
I want to dynamically add URl to send remider and add it instead of the comment above:
<a href="https://www.company.com/et/orders/<%#((Order)Container.DataItem).Parent.OrderGuid%>/reminder" target="_new">Saada meeldetuletus</a>
the URL formed correctly. Problem is that it is displayed in every row of the grid.
Insted of the simple HTML url I can use <asp:Hyperlinc to conditionally display the URL, but I can't get it to work with dynamic data:
<asp:HyperLink id="hyperlink1"
NavigateUrl="http://www.company.com/et/orders/" + <%#((Order)Container.DataItem).Parent.OrderGuid%> + "/reminder"
Text="Send reminder"
Target="_new"
Visible="<%#(int)Eval("PaymentStatusId") == (int)PaymentStatusEnum.PendingOK ? "True" : "False"%>"
runat="server"
/>
The error is: "The server tag is not well formed." The url has to redirect another domain. If I add <%#((Order)Container.DataItem).Parent.OrderGuid%> alone to NavigateUrl it's working.