Тёмный

Handling 404 error in razor pages project 

kudvenkat
Подписаться 836 тыс.
Просмотров 18 тыс.
50% 1

Опубликовано:

 

22 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@responsibleparty
@responsibleparty 4 года назад
I do not think this is the correct way to handle this. The OnGet() method should return NotFound(). And then you should add a global 404 not-found handler. The way you're doing it, you have to add a NotFound page for each case and you still won't catch not found errors that occur when the user mistypes the URL.
@rayt6867
@rayt6867 4 года назад
Hello Sir, what a pleasant surprise, very good lesson that developers tend to miss. My VS 2019 Community version is 16.4.2 and when I went to add the NoFound Razor Page using the (same as you did) Add Razor Page it did not created the proper namespace, like the one in your video, it created just namespace RazorPagesTutorial, I created another razor page in the Employees folder and it did the same. If possible what version are you using? I believe that an update broke the scaffolding engine somehow? Oh, when I do the Add --> New Item --> and select Razor Page, it works fine? Thanks Ray
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 4 года назад
Hello Ray - Mine is 16.3.8. I am glad you got it working the other way.
@Uzair_Anwar2299
@Uzair_Anwar2299 4 года назад
If we want to redirect to another page from the onget method then??
@jorgeluisdelaborbolla1026
@jorgeluisdelaborbolla1026 2 года назад
This is to handle a "NullReferenceException" and not a 404 error. Watch out the title.
@sakthivel-lc9ni
@sakthivel-lc9ni 4 года назад
Good morning Venkat sir...
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 4 года назад
Hello Sakthi - Morning. How are you doing ?
@trustingod0
@trustingod0 2 года назад
What if yiu are using a web api? Is there an error property or method that the web api uses?
@adds-kz3oc
@adds-kz3oc 4 года назад
Please do Blazor next!
@Csharp-video-tutorialsBlogspot
@Csharp-video-tutorialsBlogspot 4 года назад
Sure. We will start Blazor after this ASP .NET Core Razor Pages tutorial.
@LuigiZambetti
@LuigiZambetti 4 года назад
@@Csharp-video-tutorialsBlogspot Great Venkat!
@adds-kz3oc
@adds-kz3oc 4 года назад
@@Csharp-video-tutorialsBlogspot Thank you so much!
Далее
Editing data in asp net core razor pages
8:31
Просмотров 32 тыс.
Brutally honest advice for new .NET Web Developers
7:19
Меня знают уже все соседи😅
00:34
Кольцо Всевластия от Samsung
01:00
Просмотров 528 тыс.
How to create mvc 404 custom error page asp.net 2017
7:24
Handling 404 not found in asp net core mvc
8:51
Просмотров 80 тыс.
Registering services in razor pages project
6:10
Просмотров 33 тыс.
C# Razor Pages - Complete Tutorial
25:20
Просмотров 75 тыс.
Stop Using FirstOrDefault in .NET! | Code Cop #021
12:54
Layout view in razor pages project
10:32
Просмотров 51 тыс.
Routing in asp net core razor pages
10:24
Просмотров 37 тыс.