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'.
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.
@@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 لازم تكون موحد النوع اللى model اللى انت مستعمله سواء ك paparmeter of action or @model فى view الاتنين نفس النوع واتاكد انك محقق الشروط اللى فى data annotion of this model and form
@@NarmerAcademy حضرتك انا عملت نفس اللي ف الفيديو بالظبط وكمان نفس اللي ف السلايد وبرضوا نفس المشكلة لما بضغط علي login btn بيعمل ايرور ولما بغير ف ال model بيعمل reload لصفحة ال login