asp.net mvc: how to detect when a page is called using ajax

后端 未结 6 2009
遥遥无期
遥遥无期 2021-02-12 20:26

how to detect when a page is called using ajax in asp.net mvc ?

6条回答
  •  说谎
    说谎 (楼主)
    2021-02-12 21:01

    You would need to pass some parameter with your AJAX call - AJAX is just a GET request, no different then typing a url into the address bar and pressing enter (this is why AJAX must be guarded against cross site scripting attacks, otherwise an attacker can force people to execute AJAX commands to your site just by including the url in an image)

提交回复
热议问题