asp.net 2.0 login control

X

xke

Having a Login Control on my page caused an issue when press enter
(after filling out username and pwd fields). I manage to get through
by setting the default button for the page form:
mainForm.DefaultButton = loginbtn.UniqueID.

My problem is now with Password Recovery.
Password Recovery is a bit complicated because it's two parts process.
I want to have the same behaviour, press enter same as click on the
button.

Dim mainform As HtmlForm =
CType(Page.FindControl("form1"), HtmlForm)
mDynamicCtl =
Page.FindControl("idContent_ForgotPassword").FindControl("PasswordRecovery1")

Dim btnFPwd1 As Button =
CType(mDynamicCtl.FindControl("UserNameContainerID").FindControl("SubmitButton"),
Button)
Dim btnFPwd2 As Button =
CType(mDynamicCtl.FindControl("QuestionContainerID").FindControl("SubmitButton"),
Button)

If (Not mainform Is Nothing) And (Not btnFPwd1 Is Nothing)
Then
mainform.DefaultButton = btnFPwd1.UniqueID
End If

btnFPwd1 is the button when entering the UserName
btnFPwd2 is the button when entering the secret answer

Both of these come not null in both situations.
I couldn't find a way to make the difference which one of the buttons
is pressed. How can I figure out the default button?

Any help?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top