MVC3 Actionlink with confirmation dialog

前端 未结 3 1485
情歌与酒
情歌与酒 2021-02-13 15:13

Can I show a confirmation message for an ActionLink?

Do I need to use javascript? Is it possible without it?

Could you give some example for me?

3条回答
  •  轮回少年
    2021-02-13 15:39

    Edit: don't use this answer, use the other one from Jim.

    You won't be able to use ActionLink - you'll have to write some JavaScript (such as that listed here) to pop up a confirmation. You can use Url.Action to generate the URL that the javascript will eventually use for the post or get endpoint.

    My javascript is bad, but I think this gets the idea across:

    Checkout and view order list
    
    
    

提交回复
热议问题