user login control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neoupadhyay
    New Member
    • Feb 2007
    • 57

    user login control

    hi friends:-

    I wann to make a login user control. i m using asp.net2.0 with c#. now help me to create this. its behave like a control factory....it means.. i make a contol of login...where ever i wann to use....login conrtol just drag and drop this control to the web page and its run. so if any one have any idea that how i make plz help me..its urgent to me...

    thnx
  • urvshah
    New Member
    • Aug 2007
    • 2

    #2
    you can use master page for the same or use provider facility given by .NET 2.0. If you use <provider> tag then you can use <asp:Login> control. and make it avialble to you.

    Comment

    • neoupadhyay
      New Member
      • Feb 2007
      • 57

      #3
      sir, i think u dnt get my point....i wann to make a login user control in asp.net2.0 with c#, now its availabe to all where ever i wann touse, just drag and drop this control and it will run.

      thnx

      Comment

      • neoupadhyay
        New Member
        • Feb 2007
        • 57

        #4
        user login control

        hello all

        ....i wann to make a login user control in asp.net2.0 with c#, now its availabe to all where ever i wann to use, just drag and drop this control and it will run.

        thnx

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Originally posted by neoupadhyay
          hello all

          ....i wann to make a login user control in asp.net2.0 with c#, now its availabe to all where ever i wann to use, just drag and drop this control and it will run.

          thnx
          Why did you double post your question? Did you not read the Posting Guidelines?

          Comment

          • suriya1986
            New Member
            • Aug 2007
            • 1

            #6
            drag and drop the login control in your aspx page and include the following code


            protected void Login1_Authenti cate(object sender, AuthenticateEve ntArgs e)
            {
            try
            {
            query = "select * from Registration where UserId='" + Login1.UserName + "' and Password='" + Login1.Password + "'";
            cmd = new SqlCommand(quer y, con);
            con.Open();
            dr = cmd.ExecuteRead er();

            while (dr.Read())
            {

            if (dr["UserId"].ToString() == Login1.UserName && dr["Password"].ToString() == Login1.Password )
            {
            Server.Transfer ("Welcome.aspx" );
            }

            }
            }
            catch (Exception ex)
            {
            lblmsg.Text = ex.Message;
            }
            }

            This is the procedure to use Login Control

            Comment

            Working...