how use asp login control with oracle databse?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zaifi
    New Member
    • Dec 2008
    • 2

    how use asp login control with oracle databse?

    I how to use asp login control with oracle databse..please explain me and source code.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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.

    Comment

    • sangam56
      New Member
      • Nov 2007
      • 68

      #3
      How to user asp login control with oracle database

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

      In the aspc page:

      Code:
       
      <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate">
      </asp:Login>
      Now use the OnAuthenticate event of the Login control to validate the user.

      Code:
       
      protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
      {
      if(MyFunctionToValidateUser(Login1.UserName,Login1.Password))
      {
      FormsAuthentication.SetAuthCookie(Login1.UserName, true);
      
      //optionally keep the username in the session and treat this as
      //the authentication of the user for the whole application
      //now redirect to the page you like to 
      }
      else
      {
      //give proper messageing...
      //either using your own control or accessing the 
      //login contrl's error labels
      }
      }
      public bool MyFunctionToValidateUser(string userName, string password)
      {
      //Use your internal logic to validate user
      //You can retrieve the user information from you tables in the database
      //and validate against the input user credentials
      //return true if validated
      //else return false
      }
      Last edited by sangam56; Jan 22 '09, 09:06 AM. Reason: Posted code was not well-formatted

      Comment

      Working...