Back to Devexpress

ValidationSettings.ErrorText Property

aspnet-devexpress-dot-web-dot-validationsettings-cfe4fa2d.md

latest4.7 KB
Original Source

ValidationSettings.ErrorText Property

Gets or sets the error text to be displayed within the editor’s error frame if the editor’s validation fails.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("Invalid value")]
public virtual string ErrorText { get; set; }
vb
<DefaultValue("Invalid value")>
Public Overridable Property ErrorText As String

Property Value

TypeDefaultDescription
String"Invalid value"

A String value that specifies the error text.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ErrorText
ASPxEdit

.ValidationSettings .ErrorText

| | EditProperties |

.ValidationSettings .ErrorText

|

Remarks

The ErrorText property allows you to specify the default error text to be displayed if the editor’s validation fails. If any specific validation type is used (such as the required field or regular expression validation) or a validation event is handled, the ErrorText property’s value can be overridden. To learn more, see the Validation Error Message topic.

Example

View Example

aspx
<dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="200px" View="GroupBox" HeaderText="ValidationGroup = 'MyGroup'">
    <PanelCollection>
        <dx:PanelContent ID="PanelContent1" runat="server">  
            <dx:ASPxTextBox ID="tbTextBox3" runat="server" Width="170px" Style="margin-bottom: 4px;">
                <ValidationSettings ValidationGroup="MyGroup" ErrorText="Field is required." validateonleave="False">
                    <RequiredField IsRequired="True" ErrorText="" />
                </ValidationSettings>
            </dx:ASPxTextBox>
            <dx:ASPxTextBox ID="tbTextBox4" runat="server" Width="170px">
                <ValidationSettings ValidationGroup="MyGroup" ErrorText="Field is required." validateonleave="False">
                    <RequiredField IsRequired="True" ErrorText="" />
                </ValidationSettings>
            </dx:ASPxTextBox>
            

            <input type="button" value="Validate Group" onclick="ASPxClientEdit.ValidateGroup('MyGroup');" />
        </dx:PanelContent>
    </PanelCollection>
    <HeaderStyle Font-Size="9pt" />
</dx:ASPxRoundPanel>
aspx
<dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="200px" View="GroupBox" HeaderText="ValidationGroup = 'MyGroup'">
    <PanelCollection>
        <dx:PanelContent ID="PanelContent1" runat="server">  
            <dx:ASPxTextBox ID="tbTextBox3" runat="server" Width="170px" Style="margin-bottom: 4px;">
                <ValidationSettings ValidationGroup="MyGroup" ErrorText="Field is required." validateonleave="False">
                    <RequiredField IsRequired="True" ErrorText="" />
                </ValidationSettings>
            </dx:ASPxTextBox>
            <dx:ASPxTextBox ID="tbTextBox4" runat="server" Width="170px">
                <ValidationSettings ValidationGroup="MyGroup" ErrorText="Field is required." validateonleave="False">
                    <RequiredField IsRequired="True" ErrorText="" />
                </ValidationSettings>
            </dx:ASPxTextBox>
            

            <input type="button" value="Validate Group" onclick="ASPxClientEdit.ValidateGroup('MyGroup');" />
        </dx:PanelContent>
    </PanelCollection>
    <HeaderStyle Font-Size="9pt" />
</dx:ASPxRoundPanel>

See Also

Validation

Validation Error Message

ValidationSettings Class

ValidationSettings Members

DevExpress.Web Namespace