I've previously seen answers on Stackoverflow that involve using 'the c# construct' to essentially perform an 'if' statement in the html of a asp.net page.
So imagine i want to display Eval("option1") if its not null OR Eval("option2") if option 1 is null. How do i do this???
Hope that makes sense....
Many Thanks!!!!
An Arrow operator in C/C++ allows to access elements in Structures and Unions. It is used with a pointer variable pointing to a structure or union. The arrow operator is formed by using a minus sign, followed by the greater than symbol as shown below.
%d takes integer value as signed decimal integer i.e. it takes negative values along with positive values but values should be in decimal otherwise it will print garbage value.
The && (logical AND) operator indicates whether both operands are true. If both operands have nonzero values, the result has the value 1 . Otherwise, the result has the value 0 . The type of the result is int . Both operands must have an arithmetic or pointer type.
Is this the "if" semantics you are looking for?
<% if (condition == true) { %>
Show something
<% } else { %>
Show something else
<%} %>
You don't need if statement for it. Just use
<%= Eval("option1") ?? Eval("option2") %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With