forked from syncfusion/ej2-aspnetcore-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiselectFor.cshtml
52 lines (48 loc) · 1.67 KB
/
MultiselectFor.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@using Syncfusion.EJ2
@*@model directive allows you to access the model values*@
@model EJ2CoreSampleBrowser.Controllers.MultiselectValue
@section ControlsSection{
<div class="col-lg-12 control-section">
<div class="control-wrapper">
<div style='padding-top:70px;'>
<form method="post">
<ejs-multiselect id="multiselectfor" name="val" dataSource="@Model.data" placeholder="e.g. Basketball" ejs-for="@Model.val"></ejs-multiselect>
<div id="errorMessage">
<span asp-validation-for="val"></span>
</div>
<div id="submitbutton">
<ejs-button id="submitButton" content="Submit"></ejs-button>
</div>
</form>
</div>
</div>
</div>
}
<style>
.control-wrapper {
margin: 0 auto;
width: 250px;
}
#submitbutton {
margin: 10px auto;
text-align: center;
}
#errorMessage {
color: red;
text-align: center
}
</style>
@section ActionDescription{
<div id="action-description">
<p>
This sample demonstrates the strongly-typed extension support in <code>Multiselect</code>. The value of Multiselect is set from code behind and it is set to Multiselect in view page by invoking the strongly-typed MultiSelectFor helper.
</p>
</div>
}
@section Description{
<div id="description">
<p>
Click the submit button to post the selected value in the Multiselect. When posting the null value, validation error message will be shown below the Multiselect.
</p>
</div>
}