4
votes

I'm rewritting some of the code from MVC4 C# to MVC3 vb.net (both razor engines) and I've came upon this issue... When I try to use the WebGrid I'm getting some syntax errors with "format:=". It seems that I can't get the syntax correctly. This part of the code is faulty:

... grid.Column(

        format: 
             @<text> 
                @Html.ActionLink("Edit", "Edit", new { id=item.id })
             </text> 

            ),

...

Can somebody give me some advice or direction or help me? It's important to mention that everything else worked with WebGrid (columns etc.). But I've tried to place the edit link to the grid like in the C# version (works like a charm there).

1
I think this post addresses it: forums.asp.net/t/1664969.aspx/1 - Rikon
Try "New With {Key .id=item.id}" for the VB version. - Dave Doknjas
Rikon's post helped... @@ was needed in the format:= - Qyoo
@Qyoo: Add your answer and accept it to mark the question as closed. - Artemix

1 Answers

0
votes

@Rikon helped with his answer.

http://forums.asp.net/t/1664969.aspx/1

The whole issue was I was missing one "@", there should have been "@@". :)