public static void RegisterExpandoAttribute(Control control, string controlId, string attributeName, string attributeValue, bool encode) { if (control == null) { throw new ArgumentNullException("control"); } if (control.Page == null) { throw new ArgumentException(AtlasWeb.ScriptRegistrationManager_ControlNotOnPage, "control"); } control.Page.ClientScript.RegisterExpandoAttribute(controlId, attributeName, attributeValue, encode); ScriptManager sm = ScriptManager.GetCurrent(control.Page); if (sm != null) { RegisteredExpandoAttribute entry = new RegisteredExpandoAttribute(control, controlId, attributeName, attributeValue, encode); sm.ScriptRegistration.ScriptExpandos.Add(entry); } }