I've not had this before and there are no errors with my control.
My code behind is:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using umbraco.cms.businesslogic.member; using umbraco.cms.businesslogic.propertytype;
public partial class UserControls_RegisterMember : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { if (Member.GetMemberFromEmail(txtEmail.Text) == null) { MemberType registerMemberType = new MemberType(1212); Member newMember = Member.MakeNew(txtName.Text, registerMemberType, new umbraco.BusinessLogic.User(0));
I take it you are adding this directly to a template and not using a macro? If so then try creating a usercontrol macro and drop that onto a template see if that works.
Hi, basically I opened my website in VS, right clicked on the usercontrols folder and created a new c# usercontrol
Once complete I copied the files over to my dev site folder and then created a macro with a reference to the new control. Dropped the macro into a template and built the page. Thats when I got the error.
I did add a page directive to register the control.
When you say added page directive you mean in the master template you added it? If so then remove it as you dont need it the macro will handle everything for you.
I hosted my umbraco files in server. When I browse the properties of the control I get:
System.Web.HttpParseException (0x80004005): Could not load type 'frmppihotline.frmppihotline'. ---> System.Web.HttpParseException (0x80004005): Could not load type 'frmppihotline.frmppihotline'. ---> System.Web.HttpException (0x80004005): Could not load type 'frmppihotline.frmppihotline'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) 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) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.getCodeCompilerType() 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, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.developer.assemblyBrowser.PageLoad(Object sender, EventArgs e)
.NET usercontrol error
Hi all,
using v6+
I have a custom registration usercontrol that I created in visual studio within the site in the usercontrols folder.
I have used the directive:
<%@ Register TagPrefix="RegisterMember" TagName="RegisterMember" Src="~/UserControls/RegisterMember.ascx" %>
but I am still getting:
Error loading userControl '~/usercontrols/RegisterMember.ascx'
I've not had this before and there are no errors with my control.
My code behind is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.propertytype;
public partial class UserControls_RegisterMember : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (Member.GetMemberFromEmail(txtEmail.Text) == null)
{
MemberType registerMemberType = new MemberType(1212);
Member newMember = Member.MakeNew(txtName.Text, registerMemberType, new umbraco.BusinessLogic.User(0));
newMember.Email = txtEmail.Text;
newMember.LoginName = txtUsername.Text;
newMember.Password = txtPassword.Text;
newMember.getProperty("phoneNumber").Value = txtPhone.Text;
newMember.getProperty("subscribe").Value = chkSubscribe.Text;
Panel1.Visible = false;
lblMsg.Text = "You have been successfully registered. Thank you.";
}
else
{
lblMsg.Text = "A member with this email address already exists.";
}
}
}
So its pretty basic.
Any ideas?
Thanks
Roger,
I take it you are adding this directly to a template and not using a macro? If so then try creating a usercontrol macro and drop that onto a template see if that works.
Regards
Ismail
Hi, basically I opened my website in VS, right clicked on the usercontrols folder and created a new c# usercontrol
Once complete I copied the files over to my dev site folder and then created a macro with a reference to the new control. Dropped the macro into a template and built the page. Thats when I got the error.
I did add a page directive to register the control.
Thanks
Roger
When I browse the properties of the control I get:
System.Web.HttpParseException (0x80004005): Circular file references are not allowed. ---> System.Web.HttpParseException (0x80004005): Circular file references are not allowed. ---> System.Web.HttpException (0x80004005): Circular file references are not allowed. at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) 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) 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) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) 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.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, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)
Roger,
When you say added page directive you mean in the master template you added it? If so then remove it as you dont need it the macro will handle everything for you.
Regards
Ismail
No, I added it to the top of my usercontrol:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegisterMember.ascx.cs" Inherits="UserControls_RegisterMember" %>
<%@ Register TagPrefix="RegisterMember" TagName="RegisterMember" Src="~/UserControls/RegisterMember.ascx" %>
so I dont need the Register directive?
Thanks
roger
Roger,
No it seems like you are trying to regsiter the same user control? I would remove
The only time you would have that is if you are adding teh control on to a page / master page or another usercontrol.
Regards
Ismial
Thats great. All working. Thanks
Hi Ismail,
I hosted my umbraco files in server. When I browse the properties of the control I get:
System.Web.HttpParseException (0x80004005): Could not load type 'frmppihotline.frmppihotline'. ---> System.Web.HttpParseException (0x80004005): Could not load type 'frmppihotline.frmppihotline'. ---> System.Web.HttpException (0x80004005): Could not load type 'frmppihotline.frmppihotline'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) 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) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.getCodeCompilerType() 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, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.developer.assemblyBrowser.PageLoad(Object sender, EventArgs e)
Would you say any solutions to it.
I would run the site locally and attach visual studio debugger to it this may give you more information.
Regards
Ismial
is working on a reply...