Through an input field the color "green" is submitted.
Now, it takes requesting it.
In PHP it would be $_POST['color'].
I have thought it through, and have gotten it to this code:
The Example:
The Request for the ColorName - with VB.NET 2012 MVC 4:
Notice: The line breaks would not get preserved.
The HTML:
The Questions:
The problem in this attempt is that the color name does not get printed out, as wanted.
Invoked = to put into effect or operation (Source: The Merriam-Webster Dictionary)
Now, it takes requesting it.
In PHP it would be $_POST['color'].
I have thought it through, and have gotten it to this code:
The Example:
The Request for the ColorName - with VB.NET 2012 MVC 4:
Notice: The line breaks would not get preserved.
VB.NET:
Public Class ColorPrintOutSubmitClassController<br />
Inherits System.Web.Mvc.Controller<br />
' This method will handle GET<br />
Function PrintOutPage() As ActionResult<br />
Return View("PrintOutPage")<br />
End Function<br />
' This method will handle POST<br />
<HttpPost><br />
Function ColorPrintOut() As ActionResult<br />
' Do something<br />
Response.Write("You submitted the color: " & Request.QueryString("ColorName") & "<br />")<br />
Return View()<br />
End Function<br />
End Class<br />
The HTML:
HTML:
<form action="" method="post"> <input type="text" name="ColorName" /> <input type="submit" name="ColorName_SubmitButton" value="Print It Out!" /> </form>
The Questions:
The problem in this attempt is that the color name does not get printed out, as wanted.
- Could the problem be rather on Reponse.Write, or Request.QueryString
- Also, how does get the part which is to handle the GET - "invoked"?
Invoked = to put into effect or operation (Source: The Merriam-Webster Dictionary)