By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

how use asp login control with oracle databse?

P: 2
I how to use asp login control with oracle databse..please explain me and source code.
Dec 23 '08 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 9,731
You need to create a Membership Provider that connects to and uses your Oracle database.

Then you need to specify that your custom membership provider should be used instead of the default MySql provider. You can do this by editing your web.config <membership> section.

Check out this article for more information.
Jan 13 '09 #2

P: 68
You can validate the user by retrieving the user's credentials from the table of the oracle database.

In the aspc page:

Expand|Select|Wrap|Line Numbers
  2. <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate">
  3. </asp:Login>
Now use the OnAuthenticate event of the Login control to validate the user.

Expand|Select|Wrap|Line Numbers
  2. protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
  3. {
  4. if(MyFunctionToValidateUser(Login1.UserName,Login1.Password))
  5. {
  6. FormsAuthentication.SetAuthCookie(Login1.UserName, true);
  8. //optionally keep the username in the session and treat this as
  9. //the authentication of the user for the whole application
  10. //now redirect to the page you like to 
  11. }
  12. else
  13. {
  14. //give proper messageing...
  15. //either using your own control or accessing the 
  16. //login contrl's error labels
  17. }
  18. }
  19. public bool MyFunctionToValidateUser(string userName, string password)
  20. {
  21. //Use your internal logic to validate user
  22. //You can retrieve the user information from you tables in the database
  23. //and validate against the input user credentials
  24. //return true if validated
  25. //else return false
  26. }
Jan 22 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.