Aspx code:
<div class="col-3 col-m-12">
<div class="OrderPageContent" >
<h5 style="margin-left:20px">Status :<a style="font-weight:bold;color:green">
<asp:Button ID="Button1" CssClass="YordersButton" Text='<%#Eval("PaymentStatus") %>' runat="server" CommandName="Button1"></asp:Button></a></h5>
</div>
</div>
Please someone help, i have different type of paymentstatus for ex: Payment not verified, Payment Verified. If my paymentstatus = Payment Not verified i want to make the button background color as red, if Paymentststatus = Payment verified then then button background color as green.
Try something similar to below:
<%
if(Eval("PaymentStatus") = "Payment Verified")
{%>
Status :<a style="font-weight:bold;color:green">
<asp:Button ID="Button1" CssClass="YordersButton" Text='<%#Eval("PaymentStatus") %>' runat="server" CommandName="Button1"></asp:Button></a>
<% }
else
{
%>
Status :<a style="font-weight:bold;color:red">
<asp:Button ID="Button1" CssClass="YordersButton" Text='<%#Eval("PaymentStatus") %>' runat="server" CommandName="Button1"></asp:Button></a>
<% } %>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.