Hide asmx web methods conditionally in C#

后端 未结 2 1010
独厮守ぢ
独厮守ぢ 2021-01-22 23:57

How can I conditionally hide the web methods? I don\'t want to expose the web method if a flag setup in web.config is false. If it is true, then I will expose the web method.

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-23 00:37

    You can check the flag in your method and throw an exception if it's not set.

提交回复
热议问题