EDIT:
The function "TheColorNameFunction" is working successfully. The question is, how to have the return View()
the function has return back to the "TheRequest" View
.
SOLVED:
It simply took writing the View
name into the return View()
as following: return View("TheRequest")
The Controller:
Function TheRequest() As ActionResult
Return View()
End Function
<HttpPost()>
Function TheColorNameFunction() As ActionResult
Response.Write("The color you have submitted: " & Request.Form("ColorName"))
Return View()
End Function
The HTML:
@Html.BeginForm("TheColorNameFunction", "Home", method:= FormMethod.Post)
<fieldset>
<input type="text" name="ColorName" />
<input type="submit" name="ColorName_SubmitButton" />
</fieldset>
The HTML Second:
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
<li>@Html.ActionLink("The Request View", "TheRequest", "Home")</li>
</ul>