ASP.NET MVC: The Right Way to Handle the Undo Button

I want to have a simple cancel button, so that, confirming, say, the removal of a product, they can change their mind and click "Cancel" before the actual removal action begins.

I believe that when you click the button, you want to redirect the user to the previous page. I understand that the general way to handle this is with javascript

onclick="javascript:history.back(1);"

It is acceptable? If the user has javascript disabled, what happens?

So instead, I decided that I would submit the form and the action would redirect the user to the previous page. So should this be done? And if so, what is the C # code for this?

Thanks for any help :)

+5
source share
2 answers

javascript - POST ( ), .

-, , JavaScript- . , , javascript , , , . , , .

+3

, , jQuery , , .

async, , , , .

, , opperation .

+1

All Articles