Ads Via The Lounge
string resourceName = "ErciyesCommon.Components.MyControl.js"; ScriptManager manager = ScriptManager.GetCurrent(this.Page); if ((manager != null) && manager.IsInAsyncPostBack) { Type smType = manager.GetType(); MethodInfo RegisterClientScriptResourceMethod = smType.GetMethod("RegisterClientScriptResource", new Type[3] { typeof(WebControl), typeof(Type), typeof(string) }); if (RegisterClientScriptResourceMethod != null) { RegisterClientScriptResourceMethod.Invoke(null, new object[3] { this, this.GetType(), resourceName }); } } else { ClientScriptManager cs = this.Page.ClientScript; cs.RegisterClientScriptResource(typeof(ErciyesCommon.Components.LookupBox.LookupBox), resourceName); }