Friday, October 8, 2010

Add User Login with in a min

Flocks 2day I tried to add membership login with ASP.Net can yo believe it reducing our work with in some mins.Here I vl go through How I did !
Here there are some 2 things one is for login and another is for new account creation. I am sure tat yo can go to administrator web site so that yo can make some edit in security like adding roles for each user and access privilages.
 Also to redirect from one page to another a set of code got to be followed
try 
                { 
                    if (Membership.ValidateUser(Login1.UserName,Login1.Password)) 
                   { 
                       //Authenticated successful, redirect to the page specified in web.config as DefaultPage 
                       Response.Redirect(@"~/Personal/Default.aspx");
                    } 
     
                    else 
                   { 
                       //Authenticated failed, redirect to LoginError.aspx 
                       Response.Redirect("~/Loginerror.aspx"); 
                    } 
               } 
    
               catch (Exception ex) 
               {
                   Console.WriteLine("invalid Login");
               }  

Hope for the happy coding for any elaboration work ping me. ;)

No comments: