入力フィールドを介して、「緑」の色が送信されます。
今、それを要求する必要があります。
PHPでは$_POST['color']
。
私はそれを熟考し、このコードに到達しました:
例:
ColorNameのリクエスト-VB.NET2012MVC 4の場合:
Public Class ColorPrintOutSubmitClassController
Inherits System.Web.Mvc.Controller
' This method will handle GET
Function PrintOutPage() As ActionResult
Return View("PrintOutPage")
End Function
' This method will handle POST
<HttpPost>
Function ColorPrintOut() As ActionResult
' Do something
Response.Write("You submitted the color: " & Request.QueryString("ColorName") & "<br />")
Return View()
End Function
End Class
HTML:
<form action="" method="post">
<input type="text" name="ColorName" />
<input type="submit" name="ColorName_SubmitButton" value="Print It Out!" />
</form>
質問:
この試みの問題は、色名がprinted out
希望どおりに取得されないことです。
- 問題はむしろ
Reponse.Write
、またはにあるのRequest.QueryString
でしょうか? GET
-を処理する部分をどのように取得し"invoked"
ますか?
Invoked
=実施または運用する
(出典:メリアム・ウェブスター辞書)