Be carefull when you decide to use AllWebs property of SPSite. Some user that doesn't have access to all site might receive Access Denied error. So , I suggest to use GetSubwebsForCurrentUser() method of SPWeb.
For example look at this following code
StringBuilder sb = new StringBuilder();
foreach(SPWeb web in SPContext.Current.Site.AllWebs)
{
sb.AppendFormat("Title : {0}<br>",web.Title);
}
For user who has access to all subsite, the code will be fine. Unfortunatelly, for some users who only has access to some subsite, they will receive Access Denied error.
Therefore change to code into
StringBuilder sb = new StringBuilder();
foreach(SPWeb web in SPContext.Current.Web.GetSubwebsForCurrentUser())
{
sb.AppendFormat("Title : {0}<br>",web.Title);
}
And no more access denied problem.
-Riwut Libinuko-