Umbraco 中的用户控件问题

发布于 2024-07-29 20:38:54 字数 3268 浏览 2 评论 0原文

我开发了一个用户控件,我想将其嵌入到 Umbraco 中。 这个过程看起来很简单,但我可能正在尝试一些无法完成的事情。

我的用户控件依赖于其他几个用户控件。 当我尝试在“主”用户控件中浏览属性时,出现以下错误。

我已将所有 .ascx 文件复制到 usercontrols 文件夹中,程序集位于 bin 目录中。 是否可以在 Umbraco 中托管依赖于并包含其他用户控件的“复合”用户控件?

System.Web.HttpParseException:文件“/ucLogin.ascx”不存在。 ---> System.Web.HttpParseException:文件“/ucLogin.ascx”不存在。 ---> System.Web.HttpException:文件“/ucLogin.ascx”不存在。 在System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)在System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath,布尔noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)在System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext上下文) ,VirtualPath virtualPath,布尔noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)在System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext上下文,VirtualPath virtualPath,布尔noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)在System.Web.UI.BaseTemplateParser.GetReferencedType( VirtualPath virtualPath,布尔值allowNoCompile)在System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath)在System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry)在System.Web.UI.BaseTemplateParser.ProcessDirective(字符串directiveName,IDictionary指令) 在 System.Web.UI.TemplateControlParser.ProcessDirective(StringdirectiveName, IDictionarydirective) 在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) --- 内部异常堆栈跟踪结束 --- 在 System. Web.UI.TemplateParser.ProcessException(异常 ex) 在 System.Web.UI.TemplateParser.ParseStringInternal(字符串文本,编码 fileEncoding) 在 System.Web.UI.TemplateParser.ParseString(字符串文本,VirtualPath virtualPath,编码 fileEncoding) -- - 内部异常堆栈跟踪结束 --- 在 System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) 在 System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath) 在 System. Web.UI.TemplateParser.ParseFile(字符串物理路径,VirtualPath virtualPath)在System.Web.UI.TemplateParser.ParseInternal()在System.Web.UI.TemplateParser.Parse()在System.Web.UI.TemplateParser.Parse(ICollection) ReferencedAssemblies、VirtualPath virtualPath) 在 System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() 在 System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) 在 System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() 在 System.Web.Compilation。 BuildProvidersCompiler.PerformBuild() 在 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) 在 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, 布尔 noBuild, 布尔allowCrossApp, 布尔allowBuildInPrecompile) 在 System.Web.Compilation.BuildManager .GetVPathBuildResultWithNoAssert(HttpContext上下文,VirtualPath virtualPath,布尔noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)在System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext上下文,VirtualPath virtualPath,布尔noBuild,布尔allowCrossApp,布尔allowBuildInPrecompile)在System.Web.UI .TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at umbraco.developer. assemblyBrowser.Page_Load(Object sender, EventArgs e)

I have developed a usercontrol that I would like to embed in Umbraco. The process seems straightforward, but I may be trying something that can't be done.

My usercontrol is dependent on several other usercontrols. When I try to Browse Properties in the "main" usercontrol I get the error below.

I have copied all the .ascx files to the usercontrols folder and the assembly is in the bin directory. Is it possible to host a "composite" usercontrol in Umbraco that depends on and contains other usercontrols?

System.Web.HttpParseException: The file '/ucLogin.ascx' does not exist. ---> System.Web.HttpParseException: The file '/ucLogin.ascx' does not exist. ---> System.Web.HttpException: The file '/ucLogin.ascx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile) at System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath) at System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry) at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateControlParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath) at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

帅气称霸 2024-08-05 20:38:54

用户控件通过根路径引用其他控件。 您可以将引用 /ucLogin.ascx 更改为 ucLogin.ascx 并看看会发生什么吗?

希望它对你有帮助,

理查德

The usercontrol reference to other controls via the rootpath. Can you change the reference /ucLogin.ascx to ucLogin.ascx and see what happens.

Hope it helps you,

Richard

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文