public void ProcessRequest(HttpContext context)
{
// attempt to grab the username from the URL
// where URL = www.mysite.com/foaf_admin.axd
// username = 'admin'
var filename = context.Request.Url.ToString();
var name =
filename.Substring(filename.LastIndexOf("/") + 1).Replace(".axd", string.Empty).Replace(
"foaf_", string.Empty).Replace("foaf", string.Empty);
// if no name is specificied, then grab the first user from Membership
if (name == string.Empty)
{
foreach (MembershipUser user in Membership.GetAllUsers())
{
name = user.UserName;
break;
}
}
context.Response.ContentType = "application/rdf+xml";
this.WriteFoaf(context, name);
}