Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html.BeginForm PUT

Tags:

asp.net-mvc

It seems impossible to define PUT when I use Html.BeginForm to submit a form whilst updating an item. Is this correct?

like image 279
cs0815 Avatar asked Sep 16 '26 13:09

cs0815


1 Answers

Yes, this is correct. Browsers only support GET and POST for sending forms. You could use AJAX though:

$.ajax({
    url: '/action',
    type: 'PUT',
    data: { param1: 'value1' },
    success: function(result) {

    }
});

And if you want to AJAXify a form submission you may take a look at the jquery.form plugin.

like image 92
Darin Dimitrov Avatar answered Sep 18 '26 05:09

Darin Dimitrov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!