Created
April 19, 2012 17:07
-
-
Save gabriel403/2422345 to your computer and use it in GitHub Desktop.
When posting and specifying an obj in the args where the member vars of the obj match to the names of form elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//object | |
namespace something | |
{ | |
public class SomeObj | |
{ | |
public string SomeStr; | |
} | |
} | |
//view with a form that posts to SomePostedAction | |
<form> | |
<input type="text" name="someStr" /> | |
</form> | |
//put 'some text' in the input | |
//controller action | |
public ActionResult SomePostedAction(SomeObj someObj) | |
{ | |
//'some text' == someOBj.SomeStr | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment