Home Why I get error when I try to generate ActionLink?
Reply: 0

Why I get error when I try to generate ActionLink?

user5556
1#
user5556 Published in September 19, 2018, 3:17 am

I have this HtmlHelper:

@foreach (var item in Model) 
{
<tr>
    <td>
        @Html.ActionLink(modelItem => item.LayoutID, "someAction");
    </td>        
</tr>
}

On this row,

@Html.ActionLink(modelItem => item.LayoutID, "someAction");

i get this error:

CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type

Why do I get the above error ? The LayoutID is of string type.

EDIT Improved Formatting

share|improve this question
  • Try this: @Html.ActionLink(item.LayoutID, "someAction") – Peter B Nov 13 '17 at 12:48

2 Answers 2

active oldest votes
up vote 1 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301715 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO