Implement OTP check in Web Config

I have generated OTPs in multiple sections of my asp.net application. I want to create a check in web config so that when the check is false there is no OTP generation in the entire application and vice versa.