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: docs/the-section.md
+38-1
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,19 @@ The start and end HTML of the Section are generated via the `BeginSection` and `
56
56
57
57
## Default usage
58
58
59
+
# [Tag Helpers variant](#tab/default-section-th)
60
+
61
+
In order to output a default instance of a Section you can use the `<form-section>` tag helper within a `<chameleon-form>`, e.g.:
62
+
63
+
```cshtml
64
+
<form-sectionheading="Heading">
65
+
@*Sectionfieldsgohere*@
66
+
</form-section>
67
+
```
68
+
69
+
70
+
# [HTML Helpers variant](#tab/default-section-hh)
71
+
59
72
Inordertogetaninstanceofa `Section<TModel>` youcanusethe `BeginSection` methodontheForm, e.g.
60
73
61
74
```cshtml
@@ -144,7 +157,29 @@ The `BeginSection` extension methods look like this:
144
157
}
145
158
```
146
159
147
-
From within a Section you can create [Fields](field.md) and you can also create nested sections using the `BeginSection` extension method off the Section:
160
+
161
+
***
162
+
163
+
You can extend the Section by adding [HTML attributes](html-attributes.md) to it.
164
+
165
+
From within a Section you can create [Fields](field.md) and you can also create nested sections:
166
+
167
+
# [Tag Helpers variant](#tab/nested-section-th)
168
+
169
+
Using a nested `<form-section>` tag helper:
170
+
171
+
```cshtml
172
+
<form-section heading="Heading">
173
+
@* Fields... *@
174
+
<form-section heading="Inner Heading">
175
+
</form-section>
176
+
@* Fields... *@
177
+
</form-section>
178
+
```
179
+
180
+
# [HTML Helpers variant](#tab/nested-section-hh)
181
+
182
+
Using the `BeginSection` extension method off the Section:
148
183
149
184
```cshtml
150
185
@using (var s = f.BeginSection("Heading")) {
@@ -244,6 +279,8 @@ The `BeginSection` extension methods on Section look like this:
0 commit comments