How to generate an 401 error programmatically in an ASP.NET page

后端 未结 5 1395
无人及你
无人及你 2020-12-08 02:29

As you can see this is a question from a non web developer. I would like to have an ASPX page which, under certain circumstances, can generate a 401 error from code. Ideally

5条回答
  •  甜味超标
    2020-12-08 02:49

    Set Response.StatusCode and then - if you need to stop execution - call Response.End().

提交回复
热议问题