Return Pages -> Page is not served

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
darkdragon
User
Posts: 150

Return Pages -> Page is not served

Post by darkdragon »

Hello,

I've got an issue with a master-detail page.
I set-up in the Return Pages, After add & After Edit the option: "List Page" (otherwise I'm being redirected to the view page)

This worked OK in ANM2019, now in ANM2021 I get this error:

This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.cshtml' may be incorrect.   Please review the URL below and make sure that it is spelled correctly.

Requested URL: /Views/Home/ContractsForCessionsList.cshtml

I checked in the generated code (ViewNameEdit.cs) and I have this:

                    case "update": // Update // DN
                        CloseRecordset(); // DN
                        string returnUrl = "../Views/Home/ContractsForCessionsList.cshtml";
                        if (GetPageName(returnUrl) == "ContractsForCessionsList")
                            returnUrl = AddMasterUrl(ListUrl); // List page, return to List page with correct master key if necessary
                        SendEmail = true; // Send email on update success
                        var res = await EditRow();
                        if (res) { // Update record based on key
 ...
                        break;
                }

For the moment being I've added the listpage name in quotes


MichaelG
User
Posts: 1111

Post by MichaelG »

You should use the route (i.e. the page name without the ".cshtml" extension) instead of the cshtml file name.


darkdragon
User
Posts: 150

Post by darkdragon »

Hi Michael,

The route was not defined by me; this is the way it was generated by ANM2021.0.9, with *.cshtml.


Webmaster
User
Posts: 9427

Post by Webmaster »

Please update to the latest template (Tools -> Update Template) and try again.


Post Reply