1

I'm using YAF (Yetanotherforum), and it's in asp.net 4.0 / C#. I'm using Visual Studio 2010 and MS SQL Server Management Studio. My goal is to put a "company name" field underneath the "email" field in the registration form; currently, no 'company name' field exists.

I think I could just go to the register.ascx page and create an extra field. You could probably just copy the "email" field from tr to /tr and just paste it. For instance, on the regiser.ascx page, the email field looks like this:

                    <tr>
                        <td align="right" class="postheader">
                            <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">
                                <YAF:LocalizedLabel ID="LocalizedLabel6" runat="server" LocalizedTag="EMAIL" />
                                :</asp:Label></td>
                        <td class="post">
                            <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                                ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>

So I could just copy and paste the above, and switch all of the verbage from "email" to "company", and that would make the company name field show up on the register page, I'd think.

Assuming that's true, could anybody guide me as to how to handle the database? Or is impossible without seeing how it's set up? I'm just so new to databases, that I wouldn't feel comfortable doing anything without some solid advice -- although I already backed it up.

Thanks!

Jason Weber
  • 5,653
  • 6
  • 40
  • 73

1 Answers1

1

You really need to create a user profile - any other approach involves a hack to the out-of-the-box membership DB schema. Profiles are only supported for the ASP.NET Web Site template so if you're using the Web Application Project template, then you need to use a custom profile. More info here:

ASP.NET: Web Site versus Web Application Project

Web Profile Builder for Web Application Projects

How to add a Login, Roles and Profile system

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
  • Thank you very much for the information, Irish. I think I know what I have to do now, although it's not an easy task. But what you said makes sense, and I don't want to have to tinker with the whole source code. Thanks again for taking the time to respond! – Jason Weber Mar 28 '12 at 17:35
  • 1
    Glad to help - this was tricky to figure out when I did it first because the difference between the project types is not exactly headlined in the documentation... – IrishChieftain Mar 28 '12 at 17:45