You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/validation/message.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ position: 15
10
10
11
11
# Telerik Validation Message for Blazor
12
12
13
-
The <ahref = "https://www.telerik.com/blazor-ui/validation-message"target="_blank">Telerik Validation Message for Blazor</a> adds built-in styling and customization options on top of the standard [.NET ValidationMessage](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.validationmessage-1), such as [`Template`](#template) and [`Class`](#class) parameters.
13
+
The [Telerik Validation Message for Blazor](https://www.telerik.com/blazor-ui/validation-message) adds built-in styling and customization options on top of the standard [.NET ValidationMessage](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.validationmessage-1), such as [`Template`](#template) and [`Class`](#class) parameters.
14
14
15
15
## Basics
16
16
@@ -49,7 +49,7 @@ The Telerik Form [displays inline validation messages by default if validation i
49
49
50
50
* Use [form item templates](slug:form-formitems-template). In this case, [add the validation message in the form item template](slug:form-formitems-template#example).
51
51
* Customize the validation messages, for example, change their rendering with a [validation message template](#template). In this case, add the validation message inside a [Form item template](slug:form-formitems-template#example).
52
-
* Customize the placement of the validation messages in the Form, so that they are outside the Form item containers. In this case, consider a [`<FormItemsTemplate>`](slug:form-formitems-formitemstemplate) that gives you full control over the Form rendering between the form items. Alternatively, consider a [`<TelerikValidationSummary />`](slug:validation-tools-summary).
52
+
* Customize the placement of the validation messages in the Form, so that they are outside the Form item containers. In this case, consider a [`<FormItemsTemplate>`](slug:form-formitems-formitemstemplate) that gives you full control over the Form rendering between the form items. Alternatively, consider a [Telerik ValidationSummary](slug:validation-tools-summary).
53
53
54
54
>caption Use Telerik ValidationMessage in a TelerikForm
55
55
@@ -59,7 +59,7 @@ The Telerik Form [displays inline validation messages by default if validation i
@@ -135,15 +135,17 @@ In an existing Blazor `EditForm`, replace the `<ValidationMessage>` tags with `<
135
135
136
136
## Template
137
137
138
-
The `TelerikValidationMessage` allows you to control its rendering via a nested `<Template>` tag. The `context` represents an `IEnumerable<string>` collection of all messages for this model property.
138
+
The Telerik ValidationMessage allows you to customize its rendering with a nested `<Template>` tag. The template `context` is an `IEnumerable<string>` collection of all messages for the validated model property.
Copy file name to clipboardExpand all lines: components/validation/overview.md
+6-98Lines changed: 6 additions & 98 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,122 +10,30 @@ position: 0
10
10
11
11
# Blazor Validation Tools Overview
12
12
13
-
Telerik UI for Blazor provides different ways to show and customize validation messages. The validation tools can be used together with the [Telerik Form](slug:form-overview) or with any form that provides an [`EditContext`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editcontext) like the [standard .NET`EditForm`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editform).
13
+
Telerik UI for Blazor provides different ways to show and customize validation messages. The validation tools can be used together with the [Telerik Form](slug:form-overview) or with any form that provides an [`EditContext`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editcontext) like the [standard Blazor`EditForm`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.forms.editform).
These components add customization options on top of the standard validation tools the frameworks provides - `ValidationSummary` and `ValidationMessage`
25
+
These components add default styling and customization options on top of the standard Blazor validation tools `ValidationSummary` and `ValidationMessage`.
26
26
27
-
## Integration with the TelerikForm
28
-
29
-
You can seamlessly integrate the validation tools with the [Form Component](slug:form-overview). To avoid duplication of validation messages, set the [ValidationMessageType](slug:form-overview#form-parameters) parameter of the form to `FormValidationMessageType.None`. You can also use the validation components in [templates with custom editors](slug:form-formitems-template) that you can define with your own code.
30
-
31
-
````RAZOR
32
-
@* Disable the default validation messages from the Telerik Form and use the validation tools instead *@
[Range(10, 150, ErrorMessage = "The age should be between 10 and 150")]
113
-
public int? Age { get; set; }
114
-
115
-
[Required]
116
-
public bool IsMarried { get; set; }
117
-
}
118
-
}
119
-
````
27
+
The validation components must receive an `EditContext` instance as a cascading parameter, so they can reside in a [Telerik Form](slug:form-overview) or a standard Blazor `EditForm`.
0 commit comments