Asp.net override Membership settings at runtime (asp.net mvc)
Posted
by minal
on Stack Overflow
See other posts from Stack Overflow
or by minal
Published on 2010-04-12T23:25:48Z
Indexed on
2010/04/12
23:33 UTC
Read the original article
Hit count: 570
I had an application that hooked onto 1 single database.
The app now needs to hook into multiple databases. What we want to do is, using the same application/domain/hostname/virtual dir give the user the option on the login screen to select the "App/Database" they want to connect into.
Each database has the App tables/data/procs/etc as well as the aspnet membership/roles stuff.
When the user enters the username/password and selects (select list) the application, I want to validate the user against the selected applications database.
Presently the database connection string for membership services is saved in the web.config. Is there any way I can override this at login time? Also, I need the "remember me" function to work smoothly as well. How does this work when the user comes back to the app in 5 hours... This process should be able to identify the user and application and log in appropriately.
© Stack Overflow or respective owner