Can I use loop in <%#Eval ()%> block
I want to print series in one cell of gridview sccording to condtiotion. I have used condition from ternary operator like
<%# Eval("Sequence").ToString()=="R" ? "Sequence1" : "Sequence2" %>
but i want to pri开发者_运维知识库nt series instead of string Sequence1 and Sequence2 by loop. Have any idea.
You could, but it would get a bit messy as you would have to use something like a lambda expression to get a code block, as it has to end up being a single expression.
I suggest that you put the code in a method in your Page class, and call it from the expression.
精彩评论