PageReturn

Tag Helper <page-return />

Keeps a navigation log of pages opened to return to by using the URL and primary key to reopen the previous records.

ModelExpression PrimaryKey

The model primary key to use when returning.

string Url

The url to return to. This should include Area/Controller/View.

string PrimaryKeyField

Name of the primary key field to use. Not required if using PrimaryKey above.

string PrimaryKeyValue

Value of the primary key field to use. Not required if using PrimaryKey above.

bool AllowRecursive
Default: false

When the same page url is detected in the list, by default it will not be added again. Make this true to force adding another record at the same URL.

Tag Helper <page-return-field />

Adds extra fields to the return.

ModelExpression Field

The model field to use when returning.

string FieldName

Name of the field to use. Not required if using Field above.

string FieldValue

Value of the field to use. Not required if using Field above.

string FieldNameOverride

Override the name of the field when returning.

Tag Helper <page-return-edit />

Creates a button which navigates to another url with page return functionality.

string Url

The url to navigate to. This should include Area/Controller/View.

string Field

Name of the field to use for remote URL.

string Value

Value of the field to use. This will auto update if empty to the value in a field on the current page with the same ID.

string EditSaveButtonName
Default: Save

This simulates the Save button being pressed to allow backend attributes to find the correct method to call.

PageReturnHelper

Helper functions for Page Return.

Method

public static IActionResult DoReturn(Func<IActionResult> defaultAction, HttpContext context, ITempDataDictionary tempData)

When ready to return use this method. The defaultAction will be used if already at the top of the stack, otherwise it will redirect back to the previous page and record.

PageReturn on parent view.

Razor
<page-return primary-key="MyPrimaryKeyFieldId" url="/Controller/Edit" />

PageReturn from child view.

Razor - Parent Page
<page-return primary-key="MyPrimaryKeyFieldId" url="/ChildController/Edit" />
C#
public IActionResult EditReturn()
{
return PageReturnHelper.DoReturn(() => RedirectToAction("Edit"), HttpContext, TempData);
}

PageReturn with extra fields.

Razor
<page-return primary-key="MyPrimaryKeyFieldId" url="/Controller/Edit">
<page-return-field field="MyFieldId" />
<page-return-field field="MyField2Id" />
</page-return>

PageReturnEdit with extra fields.

Razor
<page-return-edit url="/Controller/Edit">
<page-return-field field="MyFieldId" />
<page-return-field field="MyField2Id" />
</page-return>