dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.64k stars 25.28k forks source link

PageRemote attribute #16920

Open AKTheKnight opened 4 years ago

AKTheKnight commented 4 years ago

Should there not be some documentation on the PageRemote attribute? I can't find any Microsoft documentation on it at all.

I'm using https://www.learnrazorpages.com/razor-pages/validation/remote-validation for now, but I would have expected there to be some information on it here.

Alex


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Rick-Anderson commented 4 years ago

I agree, however Mike's other article on the same topic is more accurate. It's not PageRemoteValidation as in the article you cite, it's PageRemoteAttribute

@serpent5 this look like a fun one. What's I'd do i is create a basic RP (Razor Pages) app and check for a unique userName. I'd use in-memory db. Each time you check the DB, if the DB is empty, seed it.

Alternate sample.

Create a RP app with user authorization. You may need to scaffold some of the Identity pages. Add checking for userName or whatever fields Identity requires to be unique.

The Identity sample probably wouldn't be much more complicated and has the advantage of being useful.

serpent5 commented 4 years ago

Yep, I'll take this. The existing sample is already using RP, so there might be a way to demonstrate this without adding another project. Unless that's definitely what you want...?

Rick-Anderson commented 4 years ago

~Create a dedicated RP sample app. If you go the auth route, maybe use SQLite so it runs on all platforms.~

Consider adding to this sample or writing a dedicated sample that uses UseInMemoryDatabase

Rick-Anderson commented 1 year ago

@sammychinedu2ky you might like this one. I'm updating your sample so wait until #29202 merges. Or create RP project in lieu of MVC, then you don't need to wait.

hishamco commented 1 year ago

@Rick-Anderson I might work on this, can you assign it to me, so I can't forget it accidentally :)