I had a problem with ASP and C # without any experience working on a server on which I have limited access and where I do not see the correct error logs. So get ready for a potentially confusing question :)
We have a loop (ASP repeater) in the HTML template, and part of the HTML in the template should only be included in the first iteration of the loop. Unfortunately, I cannot just hide html for other iterations, I need to remove it.
Essentially, I want to do this:
<% if (Container.ItemIndex == 0) { %> Lots of HTML here <% } %>
The problem is that this leads to an error (and I don’t see the logs, so I don’t know exactly why ...). I know that the if statement itself works (setting 0 == 0 instead works as an example), and I can get the index fine, just not here.
So the question is how to do something like this? Can I access the index in a C # if statement or is there something built into the relay that I can use?
source share