Sample: Registration widget with custom fields
Overview
This sample demonstrates how to add your own custom fields to the default template of the Registration form widget. You do this by modifying the Default.cshtml of the Profile widget and then apply the new template to the widget.
For more information, see Registration widget.
Supported field types
For the Profile widget, Sitefinity supports the following field types:
- Short text
- Long text
- Yes / No
- Date and Time
- Number
Create the custom widget template
Create a custom template for the Registration form widget in the following way:
- Open your project in Visual Studio.
- In folder
Views/Shared/Components
, create a new folder and name it SitefinityRegistration
- In the context menu of folder
SitefinityRegistration
, click Add » New Item…
- Name the file RegistrationWithCustomFields.cshtml
- Paste the code in the template and build your solution
Apply the CAPTCHA template
Perform the following:
- Open the page where the Registration form widget is located for editing.
- In the page editor, hover over the Registration form widget.
- Click the toggle menu in the widget label.
- Click
(Edit).
- In the Registration template dropdown box, select the new template.
- Save your changes.