Deny direct URL access to action method

前端 未结 5 2065
深忆病人
深忆病人 2021-02-04 11:56

I\'m trying to find a way to deny any direct access to my action methods. Basically what I want my users to click on links to navigate instead of typing the URL directly into th

5条回答
  •  耶瑟儿~
    2021-02-04 12:05

    i am not sure but maybe this can help you Consider we have a page with this url

    www.yoursite.com/home.aspx
    

    To avoid your user to directly browse this page you can rewrite you url like this

    www.yoursite.com/fdmf489ruv30/home.aspx
    

    and in this url the part "fdmf489ruv30" is a unique string that you created it on session_start and will destroy it on session_end

提交回复
热议问题