开发者

Confirmation without Javascript

开发者 https://www.devze.com 2023-03-11 00:14 出处:网络
The website I am working on must be able to work without Javascript enabled. At some point, there is a delete operation that requires confirmation so we thought about implementing the following model:

The website I am working on must be able to work without Javascript enabled. At some point, there is a delete operation that requires confirmation so we thought about implementing the following model:

There is a partial view showing 2 buttons (Yes/No) and a message.

  • If there is no Javascript, redirect to a view that will render a partial view mentioned above. Clicking Yes will redirect to another page, clicking No will redirect back.
  • If there is Javascript, use ajax to render the partial view as a message box and then redirect if Yes is clicked.

Do you think this is a good approach? Is there another way of doing this?

Another another question related to t开发者_运维问答his: Is it a good idea to have a generic controller for this kind of confirmation dialogs?


Sounds a fair approach.

I don't think a generic controller will help here, I think you want a base controller your controllers inherit from that provides the plumbing for populating your yes/no partial.

Hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消