When you want to browse programmatically a web site when you are in anonymous mode, you »ll not able to make a »foreach » on AllWebs property from SPSite object.
AllWebs property need you to be logged.So when you »re in anonymous you »ll have a popup to login that »s not really cool.
So to browse,you’2014-02-20 17:02:45’ll have to use
SPWeb.GetSubWebsForCurrentUser();