<% if(Convert.ToInt32(Eval('NbrOrders'))>=Config.MAX_ENQUIRY_SALES) { %> ... <% } else { %> ... <% } %>
Gives me a InvalidOperationException? How do I write conditional html generation in ASP?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use an inline statement as John_ states, or, create a function in your code behind that performs the logic required.
Then use this as follows
EDIT: I’ve just read a comment on another post that states you want to show different HTML depending on this result. In that case, you can try using the Visible flag of a placeholder containing your code. Such as: