Both my girls do this. I just tell them no and ignore them or play with them if I can, whatever I can do at the moment.
If they REALLY do need to go out, they won't take no for an answer and will keep ringing the bell louder and louder LOL But they are very trained at this point.