Nannette Thacker ShiningStar.net

ASP.net Web Application Development

Sponsors

News

See all Blog Posts by Nannette.

Nannette Thacker, consultant and owner of Shining Star Services LLC, specializes in development of custom dynamic database driven web applications utilizing ASP.net technologies. Nannette has been developing ASP sites since 1997. Nannette has written numerous articles on web development techniques and tutorials.

Nannette is the owner and developer of ChristianSinglesDating.com.

 Subscribe in a reader





View Nannette  Thacker's profile on LinkedIn

Log In Page - Creating a Custom Membership Provider and Membership User utilizing a Data Set Table Adapter - Step 12

On our Log In Page, we use a custom Remember Me checkbox instead of the checkbox included with the log in control. This way we can remove our log in cookie ourselves and do any database changes needed to log the user out.

Since we are using a Log In control, notice in our codebehind how we retrieve the Remember Me cookie using the FindControl to find our Login control and then the FindControl again to find the RememberMe checkbox within the Login control. Also, notice how we must find the UserName field in order to set focus on that control.

              Dim lctrl As Login
                lctrl = CType(LoginView1.FindControl("Login1"), Login)

  Dim chk As CheckBox = CType(lctrl.FindControl("RememberMeCustom"), CheckBox)

      Dim tb As TextBox = CType(lctrl.FindControl("UserName"), TextBox)
                FormUtility.SetFocusControl(tb)

Read the complete article with source code here...

Comments

Rem said:

Nice post...

# November 3, 2008 9:22 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)