Тёмный

implement a Login and Register functionality in an ASP NET Core MVC web application 

Narmer Academy
Подписаться 537
Просмотров 8 тыс.
50% 1

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

 

24 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@ebramrasmy1274
@ebramrasmy1274 Год назад
❤❤❤
@niravmehta3391
@niravmehta3391 Год назад
Getting below error, can you help me System.InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'WebApplication1.Models.User', but this ViewDataDictionary instance requires a model item of type 'WebApplication1.Models.RegisterViewModel'.
@NarmerAcademy
@NarmerAcademy Год назад
Thank you for bringing this error to our attention. This error message typically occurs when there is a mismatch between the expected model type and the actual model type being passed to the view. To resolve this issue, please ensure that the correct model type is being passed to the view. Double-check that the controller action method that is returning the view is creating an instance of the correct model type, and that this model is being passed to the view using the correct overload of the View() method. Alternatively, you may need to modify the view to accept the correct model type by updating the @model directive at the top of the view file to specify the correct type.
@SudhanshuPanthri
@SudhanshuPanthri 8 месяцев назад
Just Remove the If(ModelState.isValid) condition from Login and it should work. I may be wrong but give it a try, it worked for me
@asaadnasrallah2221
@asaadnasrallah2221 Год назад
❤❤
@abdobendary7330
@abdobendary7330 Год назад
ال login مش شغالة يا هندسة
@NarmerAcademy
@NarmerAcademy Год назад
ايه الجژء اللى مش شغال ؟! أو ايه error ؟!
@abdobendary7330
@abdobendary7330 Год назад
@@NarmerAcademy InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'Coursaty1.Models.User', but this ViewDataDictionary instance requires a model item of type 'Coursaty1.Models.RegisterViewModel'. دا ال error + لما بكتب ف ال view @model User بيعمل reload لل login مش بيدخل ع ال home انما لو سبتها @model RegisterViewModel بيطلع ال error اللي فوق + عملت class لل RegisterViewModel وعملت بعدها migration وبعدها عملت class user بس معملتش migration بعدها
@abdobendary7330
@abdobendary7330 Год назад
@@NarmerAcademy ؟
@NarmerAcademy
@NarmerAcademy Год назад
​@@abdobendary7330 لازم تكون موحد النوع اللى model اللى انت مستعمله سواء ك paparmeter of action or @model فى view الاتنين نفس النوع واتاكد انك محقق الشروط اللى فى data annotion of this model and form
@abdobendary7330
@abdobendary7330 Год назад
@@NarmerAcademy حضرتك انا عملت نفس اللي ف الفيديو بالظبط وكمان نفس اللي ف السلايد وبرضوا نفس المشكلة لما بضغط علي login btn بيعمل ايرور ولما بغير ف ال model بيعمل reload لصفحة ال login
Далее
ТЕСЛА КИБЕРТРАК x WYLSACOM / РАЗГОН
1:40:47
МЭЙБИ БЭЙБИ - Hit Em Up (DISS)
02:48
Просмотров 123 тыс.
СДЕЛАЛИ СОБСТВЕННЫЙ МУЛЬТИК
25:15
Binding in SAP UI5 || SAP UI5 Development
1:15:13
Top 20 Interview Questions - Web API - .NET C#
42:22
Просмотров 224 тыс.
ASP.NET Core Full Course For Beginners
3:43:18
Просмотров 253 тыс.
CRUD without Entity Framework in ASP.NET Core MVC
44:30