-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from MRCollective/partial-fixes
Partial fixes
- Loading branch information
Showing
11 changed files
with
161 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
ChameleonForms.Example/Views/ExampleForms/_BaseChildPartial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@model ViewModelExampleBaseChild | ||
|
||
@if (this.IsInFormSection()) | ||
{ | ||
@:@this.FormSection().FieldFor(m => m.BaseChildField).Append("From partial against child model in the base class") | ||
} | ||
else | ||
{ | ||
using (var s = this.Form().BeginSection("This is from a form-level partial against a child model in the base class")) { | ||
@s.FieldFor(m => m.BaseChildField2) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
ChameleonForms.Example/Views/ExampleForms/_BaseParentPartial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@model ViewModelExampleBase | ||
|
||
@if (this.IsInFormSection()) | ||
{ | ||
@:@this.FormSection().FieldFor(m => m.BaseField).Append("from partial against top-level model casted to base class") | ||
} | ||
else | ||
{ | ||
using (var s = this.Form().BeginSection("This is from a form-level partial against the top-level model casted to base class")) { | ||
@s.FieldFor(m => m.BaseField2) | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
ChameleonForms.Example/Views/ExampleForms/_ChildPartial.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters