Prompt file imported from Develop4Us-Company/dotnet-template (
.github/prompts/create-listing-page.prompt.md). Copyright stays with the author.
Create Listing Page
Create a search/listing page for an entity that already has a backend and Refit client implementation.
Required Information
You MUST ask the user for:
- Entity name (e.g.,
Product,Country) - Module name (e.g.,
General,Finance) - Columns to display in the data grid
- Whether advanced filters are needed (e.g., filter by parent entity)
- Whether a custom SearchRequest exists or use base
SearchRequest
Instructions
Follow the search page section of the frontend-crud skill:
- Create the search page at
src/AppProject.Web.<Module>/Pages/<EntityName>SummaryPage.razor - The page must:
- Use
@page "/<module_lowercase>/<plural_entity_lowercase>" - Use
@attribute [Authorize] - Inherit from
SearchPage<TRequest, <EntityName>Summary> - Use
SearchControlwith title, SearchText, and Take bindings - Use
DataGridControlwith columns, New/Edit/Delete handlers - Implement
FetchDataAsync()calling the summary Refit client - Implement
OnNewItemAsync()opening the form dialog - Implement
OnEditItemAsync()opening the form with the selected ID - Implement
OnDeleteItemAsync()with confirmation dialog
- Use
- If advanced filters are needed, add
AdvancedFiltersblock with dropdown components - Add resource keys for:
- Page title:
<Module>_<EntityName>SummaryPage_Title - Column titles:
<Module>_<EntityName>SummaryPage_<Column>Column_Title
- Page title:
- Add menu item in
NavMenu.razorif not already present
Reference Implementation
Look at src/AppProject.Web.General/Pages/CountrySummaryPage.razor for a simple listing page and StateSummaryPage.razor for one with advanced filters.