vendredi 24 juin 2016

Pass additional data with submit button


I have form, with two buttons:

 <form action="/Book/Crud" method="post">
        <input type="text" name="bookInput" />  
        <button type="submit">Save</button>
        <button type="submit">Save and exit</button>
    </form>

How can I pass to my controller, or, whatever, additional value, which depends on button?
<button type="submit" ?????? >Save</button> What should be here?

I am using Asp.Net Core, with this controller:

public IActionResult Crud(string bookInput)
{
    //removed code for brevity
}

Aucun commentaire:

Enregistrer un commentaire