I'm coding a page in Visual Studio, in ASP.Net MVC, and I need to display a div
only when there is a POST
on this page.
This is a form that will make POST
on the page itself. When there is POST
, I'll send a commit confirmation message.
What I have looks something like this:
@using (Html.BeginForm())
{
<fieldset>
<legend class="hidden">Contato</legend>
<div class="msg-success">
<p>Sua mensagem foi enviada com sucesso.</p>
</div>
@Html.LabelFor(m => m.Name, "Nome*")
@Html.TextBoxFor(m => m.Name, new { id = "Name" })
@Html.LabelFor(m => m.Email, "E-mail*")
@Html.TextBoxFor(m => m.Email, new { id = "Email" })
<input type="submit" id="Send" name="Send" value="Enviar" />
</fieldset>
}
I would like an equivalence to if($_POST)
to display div
:
<div class="msg-success">
<h3>Obrigado!</h3>
<p>Sua mensagem foi enviada com sucesso.</p>
<p>Aguarde, que logo entraremos em contato.</p>
<span class="close">X</span>
</div>