Steve
Steve

Reputation: 11963

Append square brackets right after a code block

i wonder how i can append the [] (string) right after a function call

something like

@Html.ActionLink("x", "y")[]

I have tried this but it results in compile error since the bracket is consider as an index operator

i want the html result to be like

<a ....>...</a>[]

Upvotes: 3

Views: 185

Answers (1)

Guffa
Guffa

Reputation: 700562

You can use parentheses to specify what's in the expression:

@(Html.ActionLink("x", "y"))[]

Upvotes: 2

Related Questions