ActionLink sending a model of a complex type

Posted by Xenph Yan on Stack Overflow See other posts from Stack Overflow or by Xenph Yan
Published on 2010-05-15T01:39:23Z Indexed on 2010/05/15 1:44 UTC
Read the original article Hit count: 244

Filed under:
|

I'm trying to paginate the results of a "advanced search", I have a complex model that represents the search options;

int ZipCode
int MinAge
int MaxAge
Availability
    bool Monday
    bool Tuesday
    ...
    bool Friday
Requirements
    bool FirstAid
    bool DriversLicense

I'm using;

<%: Html.ActionLink("Next »", "Save", "Notification", Model.options)%>

Which correctly sends all the data at the first level, but anything that is a sub-object (Availability or requirements) isn't expanded in the URL, all I get is the class name and so I lose most of the search options when I click the link to change to a different page.

Any thoughts?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about c#