c# - MVC Identity - split register into two views -


New in MVC I try to duplicate two different models (student and teacher) for the current identity register. I am having the underlying identification model inherited to the ApplicationUser. I did this so that I have different students and tutor models to use in the application, but submit them in one place and the same identification of the user and the role of the functionality take advantage of.

I modified the Account Administrator. Register the register method as a basis for creating CCS, Registration () and Register Tatore () methods of action. The only difference is that I have changed all ApplicationUser references with reference to the respective model.

I manually copied the register view and changed the register and registertuator by changing the name, changing the HtmlHelper BeginForm reference. When I navigate those paths, I can not find a "resource." This indicating error is https: // localhost: 44301 / account / registrar .

I do not like the path, when I copy the contents of Register.cbtml to Register.cshtml file, it works like a winner

< P>

You can do two things:

  1. You can create a common view (partial view) Code> RegisterTutor.cshtml and RegisterStudent.cshtml are called from within, which are called by the
  2. The following actions (CSTMTM file) directly to both functions You can refer to:

  3. Former> Public Action RegisterTutter () {var _model = 'Model object' .... .... Similar (<~ / Account / Register.cshtml}, _model)}

Similarly

  Public Execution Register Register () {Var _model = 'Model object' .... .... Return ("~ / account / register .cshtml", _model)}  

Code> Register.cshtml , if the properties are the same or you can create an interface that is firmly given It can be forced to eat and then both the models above should apply it.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -