Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @section toolbar {
- <div class="tool">
- <div class="row">
- @Html.ActionLink( Resources.Strings.Edit, "Edit", "Profile" )
- </div>
- <div class="row">
- @Html.ActionLink( Resources.Strings.Delete, "Delete", "Profile" )
- </div>
- </div >
- }
- @if (!Model.ReadOnly)
- {
- <text>
- @section toolbar {
- }
- </text>
- }
- @if(!Model.ReadOnly)
- {
- @Html.Partial("toolbar")
- }
- @section SomeSection {
- @if (!Model.ReadOnly)
- {
- }
- }
- @Html.Partial("MyAction)
- public PartialViewResult MyAction()
- {
- ...
- // determine readonly status - could have passed this to the action I suppose
- if (ReadOnly)
- {
- return PartialView("TheOneThatDefinesTheSection");
- }
- else
- {
- return PartialView("TheOneThatDoesNotDefineTheSection");
- }
- }
Add Comment
Please, Sign In to add comment