I how to use asp login control with oracle databse..please explain me and source code.
how use asp login control with oracle databse?
Collapse
X
-
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. -
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:
Now use the OnAuthenticate event of the Login control to validate the user.Code:<asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate"> </asp:Login>
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 }Comment
Comment