Is it possible to customize which Registration fields appear on Register.aspx?


InstantKB Question
Our InstantKB is configured for 'Admin Approval', so users must register and be approved before they can access the system. In addition to Username, Email, and Password, we want First Name, Last Name, Company, etc. to also appear on the Register.aspx page. Are there configuration settings that determine which fields appear, or is there a way to customize the page?
InstantKB Question

Hi Spencer,

I hope your very well. Thank you for your post. I'm afraid at the moment we don't support custom profile fields. Currently you can only add custom fields for articles, tickets etc. This is a planned feature and something we hope to offer in the future.

For now you would need to customize the registration form adding text boxes, drop down lists etc for the information you wish to capture. You can find our registration form mark-up within the following skin control /Skins/{YourSkinName}/Controls/RegistrationForm.ascx. For example you can add fields as shown below...

<!-- new custom fields -->
<tr>
<td class="TableCell_Dark">
<strong>Custom Field 1:</strong>
</td>
<td class="TableCell_Light">
<InstantASP:TextBox CssClass="FormInputText" id="TextBox1" TabIndex="1" runat="Server"/>
</td>
</tr>

<tr>
<td class="TableCell_Dark">
<strong>Custom Field 2:</strong>
</td>
<td class="TableCell_Light">
<asp:DropDownList ID="DropDownList1 runat="server">
<asp:ListItem>Value 1</asp:ListItem>
<asp:ListItem>Value 2</asp:ListItem>
</asp:DropDownList>
</td>
</tr>

<!-- /new custom fields -->

The code-behind for this skin control can be found within the InstantASP.InstantKB.UI/Controls/RegistrationForm.vb file.

You would need to update the code-behind to accommodate for your new custom fields and pass the values of these to the stored procedure that will eventually add or update the user information. Our RegistrationForm.ascx file does not actually add the information to the database. Instead this control exposes several properties and a single event delegate we use within InstantASP.InstantKB.UI/Register.vb.You may need to add some public properties to the RegistrationForm.ascx control to represent your custom fields. Then in Register.vb you can populate the properties on our user object before this is passed to our InsertUpdateUser method.

For example lets say you add a new custom field to capture the company name. You will need to add a text box to the RegistrationForm.ascx file. You will need to add a public property to the RegistrationForm.vb file called CompanyName.
In the butSubmit_Click event within Controls/RegistrationForm.vb add the following code...


Me.CompanyName = txtCompanyName.Text ' populate the public property with the value from the textbox

Then in Register.vb within the InsertUser method you can pass this company name to the CompanyName property of our user object. for example...

Dim User As New InstantASP.InstantKB.Components.User
User.EmailAddress = ctlRegistrationForm.EmailAddress
User.Password = ctlRegistrationForm.Password
User.Username = ctlRegistrationForm.Username
User.CompanyName = ctlRegistrationForm.CompanyName

I've only provided basic instructions here to point you in the right direction as quickly as possible. If you require fdurther information please don't hesitate to respond here or email me directly on ryan@instantasp.co.uk.

I look forward to your response and assisting further,

http://www.instantasp.co.uk/images/line.gif
Kindest Regards,

Ryan Healey



ryan@instantasp.co.uk
www.instantasp.co.uk
Blog | Community | Docs

http://www.instantasp.co.uk/core/assets/images/email/facebook.png http://www.instantasp.co.uk/core/assets/images/email/twitter.png http://www.instantasp.co.uk/core/assets/images/email/google.png http://www.instantasp.co.uk/core/assets/images/email/linkedin.png
GO

Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....







InstantASP Forums


Search