ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Simple sample popup form for Razor
Title:
B
I
{code}
?
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.
Save Changes
Cancel
jdpc
asked at 06 Aug 2021
Answers
B
I
{code}
?
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 of `Url.Action("Create", "DinnersGridCrud")` it could be `Url.Page("", "Create")` if a page method is returning the popup content (method called `OnGetCreate`) you can see this in our demo here: https://www.aspnetawesome.com/Download/RazorPagesDemo in `CrudPopup.cshtml` see the call to `Html.InitCrudPopupsForGrid` and inside `CrudHelpers.InitCrudPopupsForGrid` you'll see the call to `url.Page`
Save Changes
Cancel
Omu
answered 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 help
at 06 Aug 2021
jdpc
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK