Auto Login

Last post 07-04-2009 7:51 PM by hans_v. 4 replies.

Sort Posts:

  • Auto Login

    07-19-2007, 5:46 AM
    • Member
      79 point Member
    • ASPCloud
    • Member since 05-18-2007, 5:32 AM
    • Posts 112

    Hi,

    I have a login page which uses the login control, works great.

    I need to manually trigger Login Control Authenticate event,

    I have tried running the Login1_Authenticate at Page_Load but it does not work:

    protected void Page_Load(object sender, EventArgs e) {

    //...

    AuthenticateEventArgs auth = new AuthenticateEventArgs(); //probably this is wrong

    Login1_Authenticate(Login1, auth);

    //...

    }

    Also I do not know how to manually set the username and password of the Login control in code-behind, as it is only a get property.

    My issue is to let user to pass in the encrypted username and password by querystring. (This is via an affiliate link from another site)

    The login page then decrypt it and authencated user automatcally without clicking on the Ok/Submit button in the Login Control.

    Any Ideas? Thanks in Advanced.

    Filed under:
  • Re: Auto Login

    07-19-2007, 10:02 AM
    Answer
    • Member
      186 point Member
    • ShepherdWeb
    • Member since 11-08-2006, 9:56 PM
    • Posts 75

    You cannot update the Username using the default membership provider once the Username is set, using CreateUser(). However, there is nothing to prevent you from writing your own methods, or custom membership provider, that would allow you to do this.  Also, it sounds like your authentication method is going to be a custom application as well.  I would get familiar with the membership provider and the ASP.NET provider model:

    http://msdn2.microsoft.com/en-us/library/ms972319.aspx 

     I hope this helps!
     

    ★ ShepherdWeb
  • Re: Auto Login

    05-28-2008, 1:05 PM
    • Member
      23 point Member
    • snailpace
    • Member since 05-28-2008, 4:48 PM
    • Posts 186

    Hi there,

     I have used the Login Control and am able to connect to the sql database and display name using LoginName control. Just one problem, instead of displaying the user's First Name which is a field in the database, the LoginName is displaying the userid which was used to login. How do I change that? Any quick suggestionswould be greatly appreciated.

     Thanks.

  • Re: Auto Login

    07-04-2009, 6:15 PM
    • Member
      20 point Member
    • c_rob
    • Member since 07-04-2009, 10:10 PM
    • Posts 18
    You might be setting the using System; using System.OleDB.Data.DataReader; //to read Data OleDbDataReader r; r = b.ExecuteReader() //b is OleDbCommand passed to database while(r.Read()) Console.WriteLine(r.GetValue(0)); //will fetch the first column which would be your userid Console.WriteLine(r.GetValue(1)); //will fetch the name.
  • Re: Auto Login

    07-04-2009, 7:51 PM
    • Star
      8,692 point Star
    • hans_v
    • Member since 01-29-2007, 4:03 PM
    • Posts 1,499

     You just answered on a question that was asked more than a year ago! DO you really think they're still waiting for an answer!

    And by the way, how do you know that they're using OleDb?

Page 1 of 1 (5 items)