How to customize "Confirmation window"?

2

Follow the code:

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

}

How can I customize a dialog, such as a modal bootstrap?

    
asked by anonymous 04.04.2017 / 00:41

1 answer

2

This is more of a JavaScript question than ASP.NET MVC, but come on.

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

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

That is:

@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 .

    
04.04.2017 / 00:50