0

I received the following error message:

Compiler Error Message: CS0746: Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.

from the following line:

<a href="@Url.Action((string)ViewBag.RequeryAction, (string)ViewBag.Vertical, new {  filters.size ="medium"})

How can I pass the filter properties to the controller?


I have defined the following types:

class Filters {
     string Layout;
  `  bool onlyBlack
}

class Image {
    Filters filter;
    double height;
}
stj
  • 9,037
  • 19
  • 33

1 Answers1

1

You can't declare a property name with a dot in it. filter.size is not a valid name.

Use this instead:

<a href="@Url.Action((string)ViewBag.RequeryAction, (string)ViewBag.Vertical, new { filtersSize ="medium"})
shf301
  • 31,086
  • 2
  • 52
  • 86
  • it didnt get bind to the size property inside filters as the controller is expecting object of type image – c.i.g.h Aug 30 '15 at 11:56