开发者

Using ActionLink and specifying the DELETE Constraint

开发者 https://www.devze.com 2022-12-19 14:08 出处:网络
I\'m using RestfulRoutes written by Steve Hodgkiss. So far so good but I do have a question. I have a Session Controller that I want to use to destroy a users session when they click the logout button

I'm using RestfulRoutes written by Steve Hodgkiss. So far so good but I do have a question. I have a Session Controller that I want to use to destroy a users session when they click the logout button. How can I do this with and action link?

So far I have the following.

<%= Html.ActionLink("Logout", "Destroy", "Session") %>

I need to hit the following route开发者_JS百科.

Session/{id} and have a DELETE constraint.

I hope this makes sense.

Mike


An anchor tag in HTML can only ever issue a GET, it cannot issue any other verbs (unless you intervene with JavaScript).

0

精彩评论

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

关注公众号