public static bool MustBindOnPostback(IControlBinder binder) { if (binder == null) return false; return (binder.GetType().GetCustomAttributes(typeof(BindOnPostbackAttribute), false).Length > 0); }