我有一个自定义的成员提供一个Web应用程序。我想用提供商连接到Progress数据库。
I have a web application with custom membership providers. The provider I want to use connects to a Progress database.
我有一个使用competely不同成员提供一个页面。我有tried通过在web.config 设置这个,但不能得到它的工作。
I have one page that uses a competely different membership provider. I've tried setting this via the web.config but cannot get it working.
所以我在想,如果我能为这个网页编程设定的成员资格提供程序。我看到 的,它有可能在一定程度上,虽然这看起来pretty哈克。我希望有会做这种或那种方式的清洁方式。一切对SO或更广泛的网络似乎在dead结束。这表明,我认为什么我尝试是不可能的,但它会很高兴知道无论哪种方式。
So I was wondering if I could set the membership provider programmatically for this page. I see here that it is possible on some level though this looks pretty hacky. I was hoping there'd be a clean way of doing this one way or another. Everything else on SO or the wider web seems to end in a dead end. This suggests to me that what I'm attempting is not possible but it would be nice to know either way.
是否可以简单地切换的MembershipProvider在运行时?
Is it possible to simply switch the MembershipProvider at runtime?
推荐答案这是不是一个理想的解决方案,但你可以select不同的提供商在运行时。
This is not an ideal solution but you can select a different provider at runtime.
var p = (ProgressMembershipProvider)Membership.Providers["ProgressProvider"]; var user = p.GetUser("Foo", true);更多推荐
设置活动成员资格提供编程
发布评论