How to customize "Confirmation window"?

Asked

Viewed 149 times

2

Follows the code:

@using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { HttpMethod = "POST", OnSuccess = "OnSuccess", Confirm= "Tem certeza ?" }, new { @class = "form-horizontal", role = "form" }))
{

}

inserir a descrição da imagem aqui

How can I customize a dialog, like a modal bootstrap ?

1 answer

2


That’s more of a Javascript question than an ASP.NET MVC question, but come on.

The idea is to have it in your <form>:

<form onsubmit="return confirm('Tem certeza?');">

That is to say:

@using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { HttpMethod = "POST", OnSuccess = "OnSuccess" }, new { @class = "form-horizontal", role = "form", onsubmit="return confirm('Tem certeza?');" }))
{

}

See more about Window.confirm() here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.