OrchardCore 2.0 Registration with Extra fields #16759
Unanswered
yassinsayed
asked this question in
Q&A
Replies: 1 comment
-
solved it all about drivers |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i extend Registration page to contain additional fields by creating the below class (that inherit from RegisterViewModel) in Model under custom module and it works fine with OC 1.8 till i update orchardCore 2.0 now i am getting error
An unhandled exception occurred while processing the request.
InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'Castle.Proxies.RegisterViewModelProxy', but this ViewDataDictionary instance requires a model item of type 'OC.DCE.Sign.ViewModels.ceRegisterViewModel'.
How to extend the RegisterUserForm
the Class:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using OrchardCore.Email;
using OrchardCore.Users.ViewModels;
namespace OC.DCE.Sign.ViewModels
{
public class ceRegisterViewModel : RegisterViewModel
{
// To validate registration page
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public int Mobile { get; set; }
}
Beta Was this translation helpful? Give feedback.
All reactions