This project is read-only.

Integrate with MVC3

Nov 26, 2011 at 7:44 AM

Hello,

I am using MVC3 and looking to integrate your forum engine with my site. What I need is to show it within my own site. I also need to integrate the membership, so users of my site can use the forum without having to sign in again a second time. How can I do this?

Thanks

Nov 28, 2011 at 5:59 AM

You've hit a soft spot with your question. Until now MVC Forum has been running on it's own membership provider, mainly because I had to make sure people could use MVC Forum without having to write their own. I'm releasing version 0.7 shortly and haven't yet decided on a 'theme' for version 0.8, but I guess it's time to make sure MVC Forum integrates smoothly with existing MVC sites.

I don't have a lot of experience with Membership providers and how to join 2 solutions into one, so any feedback and ideas on the subject would be appreciated (or links to resources).

My initial idea would be to rewrite the MVC Forum membership provider and make it optional (for solution without an existing Membership provider). Then I'll need something that will tell MVC Forum when a new user is created, when the user changes name, e-mail address etc.

Feb 17, 2012 at 6:59 PM

With the new release (version 0.8), you should be able to use whatever provider you want. MVC Forum has a membership provider that will wrap you existing one, and make sure MVC Forum is informed whenever a user is created, deleted, etc.

Try it out and let me know if everything works out !?

Aug 1, 2012 at 5:21 AM

Hello,

Do you happen to know how to integrate this with an existing website? I have a basic MVC site right now, but I'd like to integrate MVCForum into it and use the membership provider that you've already made. I don't have much experience with MVC as of yet (building a guild website was my first attempt) but I figure using your pre-built forum is going to be much easier than trying to roll my own authentication an forum pieces.

Aug 1, 2012 at 4:57 PM

Hello rezalas

Can you describe your existing site? Do you use Entity Framework or some other framework/library for data access??

Do you have some existing users in some sort or database?

Aug 1, 2012 at 5:27 PM
It is a basic mvc 3 site with an SQL 2008 install ready for use (no database set up yet). No users at the moment, but once it is up I have about 30 people who will use it regularly.

Sent from via Windows Phone

From: steentottrup
Sent: 8/1/2012 10:57 AM
To: codlordpaul@hotmail.com
Subject: Re: Integrate with MVC3 [mvcForum:280880]

From: steentottrup

Hello rezalas

Can you describe your existing site? Do you use Entity Framework or some other framework/library for data access??

Do you have some existing users in some sort or database?

Aug 1, 2012 at 6:57 PM

Okay, but then it should be pretty easy to get started, if you clone the source, you can start coding away in the sample site included.

If you have objects you want stored in the data, you'll need to create you own data context and let it inherit from the MVCForumContext.

I'll put up an example tomorrow.

Sep 10, 2012 at 9:02 PM

Better late than never, sorry!

MVC Forum is using the MVCBootstrap project for the basic things like membership providers, data access, etc.

Take a look at http://mvcbootstrap.codeplex.com/wikipage?title=Data%20Provider&referringTitle=How%20To to see how you can add your own data objects to the data context used by MVC Forum.

Instead of inheriting from MembershipDbContext (as described in the how-to article), you'll need to inherit from MVCForumContext instead.

In general, unless it relates directly to add-ons to the forum, the documentation of the MVCBootstrap project is a good source of information.

MembershipDbContext