Reputation: 6702
Not sure if this is possible but I need my action to bind to a query string parameter with a full stop in the name. Is this possible?
For example my query string is
http://foo.com?foo.bar=test
so is there anything I can put in my method declaration so I can pick it up?
public JsonResult TestAction(string foo.bar)
(I know this wont work)
I know I can get the value from the Request
object but I'd rather not do that.
Thanks in advance
Upvotes: 0
Views: 644
Reputation: 14990
You can use the Bind attribute:
public JsonResult TestAction([Bind(Prefix="foo.bar")]string foobar)
Upvotes: 4