Click here to Skip to main content
15,790,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create reusable component in mvc

Login module with login ,change password in 3 tier architecture
In mvc

That module I want to integrate in other projects
Basically I want this model as user control

Is there any way

I was thinking create nuget package is it right way
This package I will add
Will it work??

Or there is other way

1 solution

There are two major approaches:
1) Some sort of plugin system.
As you can compile much anything in an assambly, you could simply do that, and have your login dll. But there are severeal thing to solve. So you better look for a ready-made solution. There is a concept in MVC called area. This is a good article about it: Areas in ASP.NET MVC 4[^] . You can go further creating and consuming portable areas. I suppose this will be really near to what you are looking for:[^]. It has its drawbacks, it is considered outdated (MvcContrib is not supported for some years), but this is a working coded approach. Still it is suitable for mature projects only.
See disavantages:[^]

1.5) I haven't tested this approach, but looks promising. You can use WebActivator to achive much the same results. See this:[^]

2) Using nuget. By this approach you don't create reusable component, you create reusable template for a functionality. It does not facilitate any plugin schema for your application.
Share this answer
[no name] 16-Nov-14 14:23pm    
My 5. Even "real" reusability works maybe for two years :)
Zoltán Zörgő 16-Nov-14 14:54pm    
Thank you, but what exactly do you mean?
Manas Bhardwaj 16-Nov-14 14:24pm    
Yes +5!
Zoltán Zörgő 16-Nov-14 14:55pm    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900