locked
Compilation Error RRS feed

  • Question

  • User1519602350 posted

    Hi, I am geeting error with the below. Please advise me.

    Compiler Error Message: CS1061: 'System.Collections.Generic.IEnumerable<dynamic>' does not contain a definition for 'Content' and no extension method 'Content' accepting a first argument of type 'System.Collections.Generic.IEnumerable<dynamic>' could be found (are you missing a using directive or an assembly reference?)

    Source Error:

    Line 17:     columns: grid.Columns(
    Line 18:         grid.Column("PageName", "Page Name"),
    Line 19: grid.Column(Html.Raw(users.Content), "Introduction Content"), Line 20:         grid.Column("Action", format: @<text>
    Line 21: 

    Wednesday, August 28, 2013 5:34 AM

Answers

  • User-1454326058 posted

    Hi ssvikramuk,

    Thanks for your post!

    According to your description, in my opinoin, I think you can use this code:

    gird.Column("Content",“Introduction Content")

    If I misunderstand you, please provide detail code to us.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 29, 2013 10:00 AM

All replies

  • User-821857111 posted
    Html.Raw(users.First().Content)

    Although I'm not sure that will work for you. The first argument for the column should be its name. It makes no sense to try to pass HTML as the name of the column.

    Wednesday, August 28, 2013 6:09 AM
  • User1519602350 posted

    thanks mike.  i tried with the above. getting an lambda expression error.

    Compiler Error Message: CS1978: Cannot use an expression of type 'lambda expression' as an argument to a dynamically dispatched operation

    Source Error:

    Line 18:         grid.Column("Heading", "Heading"),
    Line 19:         grid.Column("DateTime", "Date"),
    Line 20: grid.Column(Html.Raw(users.First().Content), format: @<text> Line 21: 
    Line 22:                                 <a href="@Href("~/Admin/EditNews/")@item.Id">Edit</a> |Compiler Error Message: CS1978: Cannot use an expression of type 'lambda expression' as an argument to a dynamically dispatched operation

    Source Error:

    Line 18:         grid.Column("Heading", "Heading"),
    Line 19:         grid.Column("DateTime", "Date"),
    Line 20: grid.Column(Html.Raw(users.First().Content), format: @<text> Line 21: 
    Line 22:                                 <a href="@Href("~/Admin/EditNews/")@item.Id">Edit</a> |
    Wednesday, August 28, 2013 6:19 AM
  • User-821857111 posted

    Can you explain what you expect the outcome to be?

    Wednesday, August 28, 2013 12:26 PM
  • User-1454326058 posted

    Hi ssvikramuk,

    Thanks for your post!

    According to your description, in my opinoin, I think you can use this code:

    gird.Column("Content",“Introduction Content")

    If I misunderstand you, please provide detail code to us.

    Thanks

    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 29, 2013 10:00 AM