(I am using ASP.NET MVC 2.)
How do I exclude certain properties from going into the query string when using Url.RouteUrl(object)?
Specifically, in my Model object that is being passed to my View, I have an array of strings (technically IEnumerable<string>) I want to exclude.
I thought that the Bind attribute with Exclude was supposed to do this, but it doesn’t work. I tried putting [Bind(Exclude = "Sizes")] on my class, but I keep getting URL’s that look like this:
Extension methods and Reflection to the rescue!