开发者

Can I use loop in <%#Eval ()%> block

开发者 https://www.devze.com 2023-01-15 11:10 出处:网络
I want to print series in one cell of gridview sccording to condtiotion. I have used condition from ternary operator like

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

精彩评论

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

关注公众号