/// <summary> /// 加载对话框的模板 /// </summary> /// <returns></returns> protected virtual Control LoadDialogTemplate() { DialogContentAttribute contentAttr = AttributeHelper.GetCustomAttribute <DialogContentAttribute>(this.GetType()); var contentHtml = ""; if (contentAttr != null && string.IsNullOrEmpty(contentAttr.ResourcePath) == false) { Assembly assembly = Assembly.GetExecutingAssembly(); if (string.IsNullOrEmpty(contentAttr.AssemblyName) == false) { assembly = Assembly.Load(contentAttr.AssemblyName); } LoadingDialogContentEventArgs e = new LoadingDialogContentEventArgs(); OnLoadingDialogContent(this, e); contentHtml = e.Content; if (contentHtml.IsNullOrEmpty()) { contentHtml = ResourceHelper.LoadStringFromResource(assembly, contentAttr.ResourcePath); } } contentHtml = ReplaceDialogTemplateString(contentHtml); return(Page.ParseControl(contentHtml)); }
protected virtual void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e) { if (LoadingDialogContent != null) { LoadingDialogContent(sender, e); } }
protected override void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e) { base.OnLoadingDialogContent(sender, e); }
/// <summary> /// 加载对话框的模板 /// </summary> /// <returns></returns> protected virtual Control LoadDialogTemplate() { DialogContentAttribute contentAttr = AttributeHelper.GetCustomAttribute<DialogContentAttribute>(this.GetType()); var contentHtml = ""; if (contentAttr != null && string.IsNullOrEmpty(contentAttr.ResourcePath) == false) { Assembly assembly = Assembly.GetExecutingAssembly(); if (string.IsNullOrEmpty(contentAttr.AssemblyName) == false) assembly = Assembly.Load(contentAttr.AssemblyName); LoadingDialogContentEventArgs e = new LoadingDialogContentEventArgs(); OnLoadingDialogContent(this, e); contentHtml = e.Content; if (contentHtml.IsNullOrEmpty()) contentHtml = ResourceHelper.LoadStringFromResource(assembly, contentAttr.ResourcePath); } contentHtml = ReplaceDialogTemplateString(contentHtml); return Page.ParseControl(contentHtml); }
protected virtual void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e) { if (LoadingDialogContent != null) LoadingDialogContent(sender, e); }