c# - MVC3 WebGrid column definition problem -


One of my views is WebGrid, in one of the columns I want to show an image if the user is the leader. What I'm doing so far, I do not work at the moment. Anyone know how I can do this?

The code of my problem:

  grid.Column ("FullName", header: "name", format: (item) = & gt; (item.IsLeader ( )))? @ & Lt; Text & gt; & Lt; Img src = "@ Url.Content (" ~ / content / images / leader.GIF ")" alt = "" /> & Lt; / Text & gt; : Html.ActionLink (string) item I'm getting an overload error Hope everyone can see that the full name, "index", "organization", new {domain = "catalog"}, tap),   

What i want to do here (New to razor and webgrid)

try it

  Func & lt; Dynamic, object & gt; Format = @ & lt; Text & gt; @ {If (item.IsLeader ()) {& lt; Img src = "@ Url.Content (" ~ / content / images / leader.gif ")" alt = "" /> } And {{LT; Text & gt; HTML.action link (IST) @ item.FullName, "index", "organization", new {domain = "catalog"}, tap). Ostring () & lt; / Text>; }} & Lt; / Text & gt;   

See more about delegates in the razor:

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -