Reflection
There are 2 entries for the tag
Reflection
A few extension methods to help out.....
// Project: Salient.Reflection
// http://salient.codeplex.com
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
public static class AttributeHelpers
{
/// <summary>
/// Returns first non-inherited custom attribute of type T
/// </summary>
public static T GetCustomAttribute<T>(this ICustomAttributeProvider provider)
where T : Attribute
{
return GetCustomAttribute<T>(provider, false);
}
/// <summary>
/// Returns first custom attribute of type T in the inheritance chain
...
download source code and demo
download this article in .doc format
Overview
I a previous article I complained about the lack of a true 403 Forbidden error in ASP.NET and the clumsy way that authentication is handled by FormsAuthenticationModule.
The solution I came up with was a good first attempt but, in my opinion, came up short. Particularly when handling authentication of requests that ScriptModule touches. So I decided to take another swing at it, this time with some ammunition.
I took the list of HttpModules from the root Web.config and the ScriptModule that is added to ASP.NET 3.5 web apps and dove in with...