I need to POST a Guid and an int value onto an MVC3 site.
What is the simplest way to do it?
I am using an HttpWebRequest instance on a client side.
So far I am thinking to just POST to an action-mapped URL, and include both data units as JSON data.
How do I process such case in an MVC3 action?
If you’re trying to allow a user to submit data (I couldn’t quite tell if this is what you meant from your question – if not, please clarify), you can do something like this:
Your Controller method would be:
Of course, the other alternative, depending on your needs, is create a strongly-typed view and use an object (rather than a string and an int value) to handle the data.