Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move RazorPageGenerator SelectLists from GET handler to OnPageHandlerExecutionAsync #1005

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jun 13, 2019

  1. Move SelectList code-generation into OnPageHandlerExecutionAsync

    `SelectList` initializers are only being code-generated into the GET
    handlers, but not the POST handlers.  Since `.ViewData` entries do not
    persist across responses, the page will not render correctly when the
    POST handler does not redirect (i.e. because validation failed).
    
    This change moves the initialization into a reusable
    `OnPageHandlerExecutionAsync`, which is invoked after model binding but
    before the handler itself.  No need to dual-generate the initializers
    into both handlers!
    AtOMiCNebula committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    6f06ff7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    24109fa View commit details
    Browse the repository at this point in the history