Where is Request.IsAjaxRequest() in Asp.Net Core MVC?

前端 未结 4 1343
梦毁少年i
梦毁少年i 2020-11-30 04:10

To learn more about the new exciting Asp.Net-5 framework, I\'m trying to build a web application using the newly released Visual Studio 2015 CTP-6.

Most things looks

4条回答
  •  攒了一身酷
    2020-11-30 05:16

    in asp.net core, You can use Context.Request.Headers.

    bool isAjaxCall = Context.Request.Headers["x-requested-with"]=="XMLHttpRequest"
    

提交回复
热议问题