SaaS CMS has officially launched! Learn more now.

Class XFormControlBase

Base class for XForm input controls.

Inheritance
System.Object
XFormControlBase
Implements
System.Web.UI.IPostBackDataHandler
Namespace: EPiServer.XForms.WebControls
Assembly: EPiServer.XForms.dll
Version: 10.10.4
Syntax
public abstract class XFormControlBase : WebControl, IPostBackDataHandler

Constructors

XFormControlBase()

Declaration
public XFormControlBase()

Properties

InnerLabel

A reference to the inner Label control. Used by control developers.

Declaration
protected Label InnerLabel { get; set; }
Property Value
Type Description
Label

Label

The label for the item.

Declaration
public string Label { get; set; }
Property Value
Type Description
System.String
Remarks

Returns String.Empty when not set.

Reference

The reference name for the control. This is equivalent to the model node for the control.

Declaration
public string Reference { get; set; }
Property Value
Type Description
System.String

Required

If the control requires a value when submitting data.

Declaration
public virtual bool Required { get; set; }
Property Value
Type Description
System.Boolean

Type

The type of the input that will be used when validating posted values. If no type has been specified this will be validated against the default type InvalidDefaultInputRegex.

Declaration
public virtual string Type { get; set; }
Property Value
Type Description
System.String

Value

The value for the input.

Declaration
public virtual string Value { get; set; }
Property Value
Type Description
System.String

XFormContainer

Gets the XFormControl that the control is contained in if any.

Declaration
public XFormControl XFormContainer { get; }
Property Value
Type Description
XFormControl

Methods

AddAttributesToRender(HtmlTextWriter)

Declaration
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

AddParsedSubObject(Object)

Used internally when parsing the object.

Declaration
protected override void AddParsedSubObject(object obj)
Parameters
Type Name Description
System.Object obj

CreateIdName(String, Boolean, Boolean)

CreateIDName creates a valid Id/name that must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Declaration
public static string CreateIdName(string idName, bool replaceSpace, bool alternativeStart)
Parameters
Type Name Description
System.String idName

Name or Id to validate

System.Boolean replaceSpace

True if spaces should be replaced by _

System.Boolean alternativeStart

True if all allowed charachters is accepted to start with

Returns
Type Description
System.String

DecodeXmlStringValue(String)

Declaration
protected string DecodeXmlStringValue(string originalValue)
Parameters
Type Name Description
System.String originalValue
Returns
Type Description
System.String

EncodeStringValue(String)

Declaration
protected string EncodeStringValue(string originalValue)
Parameters
Type Name Description
System.String originalValue
Returns
Type Description
System.String

EncodeXmlStringValue(String)

Declaration
protected string EncodeXmlStringValue(string originalValue)
Parameters
Type Name Description
System.String originalValue
Returns
Type Description
System.String

GetRenderName()

Returns the name that will be used when rendering the control to html.

Declaration
protected string GetRenderName()
Returns
Type Description
System.String

Either the reference for the XForm field or an Unique ID.

IsValidInput()

Validates the data and returns if the data is valid or not.

Declaration
public bool IsValidInput()
Returns
Type Description
System.Boolean

If the control has a type defined this will be used for validation, otherwise it will be validated against InvalidDefaultInputRegex

LoadPostData(String, NameValueCollection)

Used internally to control if a field has been updated.

Declaration
public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection)
Parameters
Type Name Description
System.String postDataKey
System.Collections.Specialized.NameValueCollection postCollection
Returns
Type Description
System.Boolean

OnInit(EventArgs)

Declaration
protected override void OnInit(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

RaisePostDataChangedEvent()

Declaration
public virtual void RaisePostDataChangedEvent()

RenderAttributes(HtmlTextWriter)

Declaration
protected virtual void RenderAttributes(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

RenderBeginTag(HtmlTextWriter)

Declaration
public override void RenderBeginTag(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

RenderEndTag(HtmlTextWriter)

Declaration
public override void RenderEndTag(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

RenderID(HtmlTextWriter)

Declaration
public virtual void RenderID(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

RenderLabel(HtmlTextWriter)

Declaration
public virtual void RenderLabel(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

RenderName(HtmlTextWriter)

Declaration
public virtual void RenderName(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

RenderValue(HtmlTextWriter)

Declaration
public virtual void RenderValue(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

Events

ValueChanged

Declaration
public event EventHandler ValueChanged
Event Type
Type Description
System.EventHandler

Implements

System.Web.UI.IPostBackDataHandler

Extension Methods