Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static attribute PathAttribute
- {
- public string Path {get;set;}
- }
- [Path("/blah/blah/blah")]
- public class MyControl : UserControl {}
- public abstract class EasyUserControl<T> : UserControl
- {
- public static T Create()
- {
- var UCPath = typeof(T).GetCustomAttributes(typeof(PathAttribute, false))[0].Path;
- return (T)(object)((Page)HttpContext.Current.Handler).LoadControl(UCPath);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement