Copied to clipboard

Flag this post as spam?

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


  • Teena 44 posts 64 karma points
    Sep 30, 2010 @ 04:07
    Teena
    0

    "Setting up membership in Umbraco" - Could it be that easy?

    Hi. 

    Our install is umbraco v 4.0.4.2 (Assembly version: 1.0.3811.17115) and I am attempting to follow the process outlined at http://www.mortenbock.dk/blog/2009/04/01/setting-up-membership-in-umbraco.aspx.  ;

    1. Created the member group
    2. and member type
    3. and edited the web.config

      but when I attempt to
    4. create the Sign Up form by duplicating a public template and entering:
      <script runat="server">

      protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
      {
         
      Roles.AddUserToRole(CreateUserWizard1.UserName, "BasicUsers");
      }

      protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)
      {
         
      Response.Redirect("/member-area.aspx");
      }

      </script>

      <asp:CreateUserWizard ID="CreateUserWizard1" OnContinueButtonClick="CreateUserWizard1_ContinueButtonClick" OnCreatedUser="CreateUserWizard1_CreatedUser" runat="server">
         
      <WizardSteps>
             
      <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"></asp:CreateUserWizardStep>
             
      <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"></asp:CompleteWizardStep>
         
      </WizardSteps>
      </asp:CreateUserWizard>
      I get a big error:
      Server Error in '/' Application.
      Control 'ctl00_ctl00_ctl00_ContentPlaceHolderDefault_CreateUserWizard1' of type 'CreateUserWizard' must be placed inside a form tag with runat=server.
    5. Searching the forum, I came across this advice:
      The "...must be placed inside a form tag with runat=server" message means you don't have your code running inside an ASPNET_FORM block. You can add this in your template. Either just for this page or in your master template so that all pages have the ASPNET_FORM available. I prefer to put it in only where it's needed but many people just put it in their master template.

      No matter where you put it, this is what it looks like:
      <?ASPNET_FORM>
      <div class="MainContent">
      <?UMBRACO_MACRO macroAlias="yourMacro"></?UMBRACO_MACRO>
      </div>
      </?ASPNET_FORM>
      So I tried  wrapping #4 in #5,

      <?ASPNET_FORM>
      <script runat="server">

      protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
      {
         
      Roles.AddUserToRole(CreateUserWizard1.UserName, "BasicUsers");
      }

      protected void CreateUserWizard1_ContinueButtonClick(object sender, EventArgs e)
      {
         
      Response.Redirect("/member-area.aspx");
      }

      </script>

      <asp:CreateUserWizard ID="CreateUserWizard1" OnContinueButtonClick="CreateUserWizard1_ContinueButtonClick" OnCreatedUser="CreateUserWizard1_CreatedUser" runat="server">
         
      <WizardSteps>
             
      <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"></asp:CreateUserWizardStep>
             
      <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"></asp:CompleteWizardStep>
         
      </WizardSteps>
      </asp:CreateUserWizard>
      </?ASPNET_FORM>

      This returned a similar error.

    Some of this information is reaching back to 2008.  Is this tutorial relevant to the 4.0.4 version?  Is there an easier way to do this?  All I really need is a login and a profile editor.

    Thanks in advance.

  • Anders Brännmark 228 posts 280 karma points
    Sep 30, 2010 @ 07:03
    Anders Brännmark
    0

    <form runat="server">YOUR_FORM_MACRO_HERE</form> if you are using ASP.net masterpages.

  • Teena 44 posts 64 karma points
    Sep 30, 2010 @ 09:34
    Teena
    0

    Excellent! We have a working login form. 

    Bless you my child and may all your children prosper.

  • Anders Brännmark 228 posts 280 karma points
    Sep 30, 2010 @ 14:11
    Anders Brännmark
    0

    No worries :-)

Please Sign in or register to post replies

Write your reply to:

Draft