Thursday, July 23, 2009

The HTML <button>

I was getting a bit confused about some of the attributes on the HTML <button> element so I thought that I'd write them out to clear it in my mind.

Here's the example:

<button name="submitName" value="submitValue">Submit</button>

In the Action on the Controller (of the ASP.NET MVC app) the following statement:

            string submit = Request.Form["submitName"];

will set submit to that value of "submitValue"

i.e. name/value pair.

"submitName" in the Request.Form is not case sensitive. You can put "SubMitnaMe" and it will still find the value by that name/key.

No comments:

Post a Comment