Table of Contents

Class FormWidgetProperties

Namespace
Kentico.Forms.Web.Mvc.Widgets
Assembly
Kentico.Content.Web.Mvc.dll

Form widget properties

public class FormWidgetProperties : IWidgetProperties, IComponentProperties, IComponentProperties
Inheritance
object
FormWidgetProperties
Implements
Extension Methods

Properties

AfterSubmitDisplayText

The text to be displayed after a form submission.

[VisibleIfEqualTo("AfterSubmitMode", "message")]
[RequiredValidationRule(ErrorMessage = "{$kentico.formwidget.aftersubmit.displaymessage.errormessage$}")]
public string AfterSubmitDisplayText { get; set; }

Property Value

string

Remarks

The text specified in this property is displayed when the AfterSubmitMode property value is set to DISPLAY_MESSAGE.

AfterSubmitMode

Specifies an action that occurs after a user submits a form on the live site.

[RequiredValidationRule]
public string AfterSubmitMode { get; set; }

Property Value

string

Remarks

Use constants from the FormAfterSubmitModeConstants class.
For the Display message after submit use DISPLAY_MESSAGE mode. To set message text use AfterSubmitDisplayText property.
For the Redirect to specific URL use REDIRECT_TO_URL mode. Set URL by AfterSubmitRedirectToUrl property. For the Redirect to web page mode use REDIRECT_TO_WEBPAGE mode. To set page where user will be redirected use AfterSubmitRedirectToWebPage property. This option can be set only when the form widget is used on a page routed by the content-tree-based routing.

AfterSubmitRedirectToUrl

The URL to be redirected to after a form submission.

[VisibleIfEqualTo("AfterSubmitMode", "URL")]
[RequiredValidationRule(ErrorMessage = "{$kentico.formwidget.aftersubmit.redirecttourl.errormessage$}")]
[UrlValidationRule(AllowRelativeUrl = true)]
public string AfterSubmitRedirectToUrl { get; set; }

Property Value

string

Remarks

User is redirected to the specified URL when the AfterSubmitMode property value is set to REDIRECT_TO_URL.

AfterSubmitRedirectToWebPage

The web page to be redirected to after a form submission.

[VisibleIfEqualTo("AfterSubmitMode", "web page")]
[RequiredValidationRule(ErrorMessage = "{$kentico.formwidget.aftersubmit.redirecttopage.errormessage$}")]
public IEnumerable<WebPageRelatedItem> AfterSubmitRedirectToWebPage { get; set; }

Property Value

IEnumerable<WebPageRelatedItem>

Remarks

User is redirected on the selected web page when the AfterSubmitMode property value is set to REDIRECT_TO_WEBPAGE.

SelectedForm

Selected form code name.

[RequiredValidationRule]
public IEnumerable<ObjectRelatedItem> SelectedForm { get; set; }

Property Value

IEnumerable<ObjectRelatedItem>