Create the BugForm view
After you create the BugModel class, you create the BugForm view. The BugForm view represents a form that is used by the user to log a new bug. To create the BugForm view:
- In Visual Studio, navigate to the Areas » BugTracker » Views » Bug`` folder, create a new file with the
cshtmlextension.
Name the fileBugForm. - Add
usingstatements to the following namespaces:Telerik.Web.Mvc.UITelerik.Sitefinity.ModelTelerik.Sitefinity.DynamicModules.Model
- Set the layout of the view.
Use theBugTrackerLyoutview as the layout. - Define a form:
- Use the
BeginFormmethod of theHtmlHelperobject. - Specify the action, controller and the route values. The form navigates to the specified URL after it is submitted.
- Specify the method of the form to be
FormMethod.Post.
Note that you have to put the call to theBeginFormmethod inside a using clause.
- Use the
- Define the input fields:
- Inside the
usingclause for theBeginFormmethod, create afieldsetelement. - Inside the element define the input fields for the bug details.
When defining the choice fields, set their values to the same values as the one defined for the Bug content type in the custom module. Note that the names of the input fields must be the same as the names of the properties of theBugModelclass.
- Inside the
GITHUB EXAMPLE: For more information about the content of the file, see the BugForm.cshtml file of the downloaded sample project.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
Get started with Integration Hub | Sitefinity Cloud
This free lesson teaches administrators, marketers, and other business professionals how to use Sitefinity Integration Hub to create automated workflows between Sitefinity and other business systems.
Web Security for Sitefinity Administrators
This free lesson teaches administrators the basics about protecting your Sitefinity instance and your sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
Foundations of Sitefinity ASP.NET Core Development
The free on-demand video course teaches developers how to use Sitefinity ASP.NET Core and take advantage of its decoupled architecture and modern development model.