Simple sample popup form for Razor
it's possible provide a simple sample of calling a popup form for Razor pages, content a text control and a method associated with ok.
jdpc
asked
at 06 Aug 2021
Answers
-
the code that you see here: https://demo.aspnetawesome.com/PopupFormDemo will work the same on Razor Pages, the only difference could be when you set the
.Url(string)
so instead ofUrl.Action("Create", "DinnersGridCrud")
it could beUrl.Page("", "Create")
if a page method is returning the popup content (method calledOnGetCreate
) you can see this in our demo here: https://www.aspnetawesome.com/Download/RazorPagesDemo inCrudPopup.cshtml
see the call toHtml.InitCrudPopupsForGrid
and insideCrudHelpers.InitCrudPopupsForGrid
you'll see the call tourl.Page
Omuanswered at 06 Aug 2021-
Very Thanks, My main problem was related to the content of the popupform. I see that I need to implement in the OnGetCreate method the use of PageModel.Partial (url) and call the Create.cshtml page. Thanks for the helpat 06 Aug 2021 jdpc
-