Class FormViewModel
- Namespace
- Dynamicweb.Forms
- Assembly
- Dynamicweb.Forms.dll
Represents a view model for rendering a form with its fields and field options in a razor template.
public class FormViewModel : ViewModelBase
- Inheritance
-
FormViewModel
- Inherited Members
- Extension Methods
Constructors
FormViewModel()
Initializes a new instance of the FormViewModel class without fields and submits.
public FormViewModel()
Properties
CssClass
Gets or sets the CSS class of the form.
public string? CssClass { get; set; }
Property Value
Fields
Gets the collection of form fields, including inactive fields. Check Active before rendering a field.
public IEnumerable<FormFieldViewModel> Fields { get; }
Property Value
ID
Gets or sets the ID of the form.
public int ID { get; set; }
Property Value
MaxSubmits
Gets or sets the maximum number of submits for the form. Zero means no limit.
public int MaxSubmits { get; set; }
Property Value
Name
Gets or sets the name of the form.
public string? Name { get; set; }
Property Value
Methods
GetSubmits()
Retrieves the submits already made to the form.
public IEnumerable<FormSubmitViewModel> GetSubmits()
Returns
- IEnumerable<FormSubmitViewModel>
The collection of form submits.