asp.net - Prevent user from accessing an action which is accessible by code -
i utilize latest mvc, attribute routing.
when user submits contact form, redirects "thank submitting info" view, route foo.com/success
.
how can configure code can redirect success
action usual, user cannot navigate directly?
if not have link in page, user won't access directly. otherwise if user cannot access it, cannot access via code neither.
[httpget] public actionresult myaction(){ //... homecoming redirecttoaction("success"); } [httpget] public actionresult success(){ viewbag.result = "thank submitting info"; homecoming view(); }
asp.net asp.net-mvc attributerouting
No comments:
Post a Comment