Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Roger 195 posts 474 karma points
    Oct 03, 2013 @ 16:47
    Roger
    0

    .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

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Oct 03, 2013 @ 16:53
    Ismail Mayat
    0

    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

  • Roger 195 posts 474 karma points
    Oct 03, 2013 @ 17:00
    Roger
    0

    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

  • Roger 195 posts 474 karma points
    Oct 03, 2013 @ 17:08
    Roger
    0

    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)

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Oct 03, 2013 @ 17:10
    Ismail Mayat
    0

    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

  • Roger 195 posts 474 karma points
    Oct 03, 2013 @ 17:12
    Roger
    0

    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

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Oct 03, 2013 @ 17:15
    Ismail Mayat
    100

    Roger,

    No it seems like you are trying to regsiter the same user control? I would remove

    <%@ Register TagPrefix="RegisterMember" TagName="RegisterMember" Src="~/UserControls/RegisterMember.ascx" %>
    

    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

  • Roger 195 posts 474 karma points
    Oct 03, 2013 @ 17:23
    Roger
    0

    Thats great. All working. Thanks

  • Shahul 2 posts 22 karma points
    Jan 23, 2014 @ 13:44
    Shahul
    0

    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.

  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Jan 23, 2014 @ 15:08
    Ismail Mayat
    0

    I would run the site locally and attach visual studio debugger to it this may give you more information.

    Regards

    Ismial

Please Sign in or register to post replies

Write your reply to:

Draft