将 YAF.NET 集成到我的 MVC3 Razor 解决方案中
我想知道是否有办法将 YAF.NET 集成到我的 MVC3 应用程序中?
我不希望 YAF 位于我的页面内,就像使用我的母版页或类似的东西一样,我只希望它位于 /forum
这样的子文件夹中,并且如果用户单击“forum”< /em> 链接他将被重定向到论坛。
将来我还想在我的页面上使用登录系统,所以我必须考虑会员提供商。我知道有一种方法可以让 YAF 使用基本的 ASP.NET 会员提供程序,但是 yaf 能以这种方式与 mvc 3 一起工作吗?由于 yaf 不是 .NET 4 应用程序,我想知道如何迁移会员资格提供程序?
如果没有会员资格的解决方案,我应该能够从我的页面链接到 YAF?
编辑:
我的解决方案->
1)我添加了一个子域并配置了我的两个域以使用指向运行 IIS 的服务器的 A 记录。
2)我添加了2个网站。第一个是带有 MVC3 应用程序的主网站,第二个是 YAF.NET 论坛。
3) 我编辑了两个网站的绑定设置(IIS 管理器 -> 站点 -> yoursite -> 绑定)并删除了 IP 绑定,而不是添加了 HTTP 标头。对于主站点 = mydomain.com 以及对于论坛 forum.mydomain.com
I would like to know if there is a way to integrate YAF.NET to my MVC3 Application?
I dont want YAF to be inside my page like using my masterpage or stuff like that, I just want it to be in a subfolder like /forum
and if a user clicks the "forum" link he will be redirected to the forum.
In the future I also would like to use a login system for my page, so I have to think about membership provider. I know that there is a way to make YAF use your basic asp.net membership provider but will yaf work with mvc 3 in that way? Since yaf isn't a .NET 4 application I wonder how I could migrate the membership provider?
If there isn't a solution for the membership stuff, I should be able to just link from my page to YAF?
EDIT:
My solution ->
1)I added a subdomain and config both of mine domains to use an A-Record which points to the Server where IIS is running.
2)I added 2 Websites. The first one is my Main Website with my MVC3 Application and the second one is the YAF.NET Forum.
3) I edited the binding settings of both of the websites (IIS Manager -> Sites -> yoursite -> Binding) and removed the IP binding insteed i added a HTTP header. For mainsite = mydomain.com and for the forum forum.mydomain.com
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于第一部分,您可以将 YAF 安装在网站上的虚拟目录(例如
www.mywebsite.com/forums/
)中,并让它在那里独立运行。/forums
)对于第二个,您可以做的是从 MVC 应用程序中使用,直接读取 YAF 的用户数据库(无论它在哪里)并使用它来验证您的用户。
YAF 的最新版本基于 ASP.net 3.5,您可以尝试获取源代码并为 .NET4 构建它,尽管这是没有必要的,因为您说过您不想将您的应用程序与它混合在一起,而是并行运行它并让它们互操作。 (还有一些针对 CMS 的 UserControl 功能,您可能想检查一下)
在 功能 页面上显示YAF 支持 asp.net 成员资格和角色,因此您也不应该遇到问题。
For the first part, you can just install YAF in a virtual directory on your website like
www.mywebsite.com/forums/
and let it run standalone there./forums
)For the second, what you could do is use from your MVC app, directly read YAF's database of users (wherever it is) and use it to authenticate your users.
The Latest build of YAF is on ASP.net 3.5, you could try getting the source and building it for .NET4, although this would not be necessary since you said you don't want to mash your app with it but run it side-by-side and have them interop. (There also is some UserControl feature for CMS's you might want to check that out)
On the features page it says YAF supports asp.net memberships and roles, so you shouldn't have a problem there either.