Login Control, ImageButton, Default Button...

I feel like I do a lot of bitching about the DefaultButton property.  But anyway...

What happens when you're using a Login control, and you decide to use an ImageButton for the Login button?  You guessed it, you break the DefaultButton property.

''Make the login button of the login control the default button. This is useful when your login control uses an image button.

''Doing so makes the DefaultButton property do nothing.

Dim loginControl As Control = Me.FindControl("Login1")

If Not loginControl Is Nothing Then

Dim loginButton As Control = loginControl.FindControl("LoginButton")

If Not loginButton Is Nothing Then

pnlLogin.DefaultButton = loginButton.UniqueID.Remove(0, pnlLogin.Parent.UniqueID.Length + 1)

End If

End If

Print | posted on Monday, August 25, 2008 12:09 PM

Feedback

No comments posted yet.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 4 and 8 and type the answer here: