Repository navigation
Expand file tree
/
Copy pathTextboxFor.cshtml
More file actions
59 lines (53 loc) · 1.93 KB
/
Copy pathTextboxFor.cshtml
File metadata and controls
59 lines (53 loc) · 1.93 KB
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
53
54
55
56
57
58
59
@using Syncfusion.EJ2
@*@model directive allows you to access the model values*@
@model EJ2CoreSampleBrowser.Controllers.TextBoxes.TextBoxValue
@section ControlsSection{
<div class="control-section">
<div id="wrapper" class="textbox-section">
<div id="textbox-control">
<form method="post">
<ejs-textbox id="textboxfor" name="firstname" placeholder="First Name" floatLabelType="Auto" ejs-for="@Model.firstname"></ejs-textbox>
<div id="errorMessage">
<span asp-validation-for="firstname"></span>
</div>
<div id="submitbutton">
<ejs-button id="submitButton" content="Post"></ejs-button>
</div>
</form>
</div>
</div>
</div>
}
@*custom code start*@
<style>
#wrapper {
max-width: 246px;
margin: 30px auto;
padding-top: 50px;
}
#submitbutton {
margin-top: 20px;
margin-left: 65px;
}
#control-content #wrapper .field-validation-error {
color: red;
}
</style>
@*custom code end*@
@section ActionDescription{
<div id="action-description">
<p>
This sample demonstrates the strongly typed extension support in the <code>Textbox</code>. The Textbox value is set to textbox from code behind and its set to textbox in a view page by invoking the strongly typed TextboxFor helper.
</p>
</div>
}
@section Description{
<div id="description">
<p>
Click the submit button to post the selected value in the textbox. When posting the null value, a validation error message will be shown below the textbox.
</p>
</div>
}
@section Meta{
<meta content= "The ASP.NET Core TextBox supports strongly typed helper (TextboxFor control). It binds a value from the controller using model binding for data annotation." />
}