0
This is my controller:
[HttpPost]
public ActionResult TestePost(int id1)
{
ViewData["Teste"] = "O método POST funcionou, você digitou: " + id;
return View("Index");
}
[HttpGet]
public ActionResult TesteGet(int id)
{
ViewData["Teste"] = "O método GET funcionou, você digitou: " + id;
return View("Index");
}
Below my view:
@using (Html.BeginForm("TesteGet", "Home", FormMethod.Get))
{
<fieldset>
<legend>Form tipo GET</legend>
<input type="text" name="id" id="idGet" value="" />
<input type="submit" name="enviar" value="enviar Get" placeholder="apenas numeros" />
</fieldset>
}
<br/>
<hr/>
<br/>
@using (Html.BeginForm("TestePost", "Home", FormMethod.Post))
{
<fieldset>
<legend>Form tipo POST</legend>
<input type="text" name="id1" id="idPost" value="" />
<input type="submit" name="enviar" value="enviar Post" placeholder="apenas numeros"/>
</fieldset>
}
<h1>@ViewData["Teste"]</h1>
My problem: Method GET
works perfectly, method post
doesn’t work.
Rebound: When is localhost works perfectly POST and GET when I put in Locaweb gives this error.
You published on Ocaweb?
– Érik Thiago
Unfortunately yes.
– Rolim
One more soldier down!
– Diego Souza
Cara goes to Redehost or Umbler, because Locaweb is just a headache, I’ve been there.
– Matheus Miranda