MR 2.0
.Net 3.5
I am attempting to redirect to an action using an anonymous object.
the problem is one of my parameters is a composite node. This
var sort = new Sort{By="Name", Ascending = true};
RedirectToAction("Index", new {page, term, sort});
produces the url
Index.castle?page=1&term=foo&sort=My.Namespace.Sort
which makes sense to some degree. however I want it to build the url
Index.castle?page=1&term=foo&sort.By=Name&sort.Ascending=true
currently I am building my parameters from a hashtable
var sort = new Sort{By="Name", Ascending=true};
var parameters = new Hashtable
{
{"page",page},
{"term",term},
{"sort.By",sort.By},
{"sort.Ascending",sort.Ascending},
};
RedirectToAction("Index", parameters);
Is it possible to build a url from a anonymous, composite object?
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.