开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜