Images in MvcContrib Grid
Posted
by HeartKiller
on Stack Overflow
See other posts from Stack Overflow
or by HeartKiller
Published on 2010-05-26T07:55:14Z
Indexed on
2010/05/26
8:01 UTC
Read the original article
Hit count: 235
mvccontrib
Hi guys,
Topic question:
If i already have helper which returns me image according with parameter (true or false) I called it like this
<%=Html.Status(item.Availible)%>
and it is returns me
I was thisnking to use MvcContrib but i cant use <%= %> syntax in embeded blocks http://www.jeremyskinner.co.uk/2009/02/22/rewriting-the-mvccontrib-grid-part-2-new-syntax/comment-page-1/#comment-3596
Then i find out that it is possible to do like this: p => "").Named.(“A”).DoNotEncode();
But i want to put conditions, somth that like that:
if(item.Availible) column.For(p => "").Named (“A”).DoNotEncode(); else column.For(p => "").Named(“A”).DoNotEncode();
i was tried to make it like this:
column.For(p => ((item.Availible==false) ? "" : "").Named(“A”).DoNotEncode();
but it is doesn't working properly.
is there any way of doing this?
© Stack Overflow or respective owner