DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   ASP.NET (http://www.daniweb.com/forums/forum18.html)
-   -   Enter doesn't execute button.click (http://www.daniweb.com/forums/thread6989.html)

Slade Jun 14th, 2004 4:23 am
Enter doesn't execute button.click
 
1 Attachment(s)
For some reason, when I am in the password text box, when I press enter, it simply clears both fields. Doesn't validate, doesn't login, just clears the fields. What is going on here?

Codebehind:
 
PrivateSub cmdLogin_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.ServerClick
If FormsAuthentication.Authenticate(txtUser.Text, txtPass.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, chkPersist.Checked)
Else
lblStatus.Text = "Not Authenticated"
IfCInt(ViewState("Tries")) > 1 Then
Response.Redirect("Denied.aspx")
Else
' Otherwise, increment number of tries.
ViewState("Tries") = CInt(ViewState("Tries")) + 1
EndIf
EndIf
EndSub


And the aspx page is attached. Please help.

Slade

Tekmaven Jun 26th, 2004 8:06 pm
Re: Enter doesn't execute button.click
 
Is the viewstate enabled? Is the page properly posting back? Try putting in a Response.Write somewhere...

Slade Jun 26th, 2004 8:46 pm
Re: Enter doesn't execute button.click
 
clicking on the button actually works but..?

Slade Jul 15th, 2004 11:16 pm
Re: Enter doesn't execute button.click
 
ok clicking on the actual button with the mouse WORKS, but when I hit enter and I'm in the password field, it just clears the form whats the deal? It should just login like when I click it, please help.


Thanks in advance,

Slade

Tekmaven Jul 17th, 2004 1:30 pm
Re: Enter doesn't execute button.click
 
Ah, well, when you hit enter, the button isn't a default button :-P. You'll either need to write some javascript here, or use the free MetaBuilder's DefaultButtons Control.

Slade Jul 18th, 2004 7:05 pm
Re: Enter doesn't execute button.click
 
As always tekmaven you were helpful, that control is awesome. Where do you find out about all of them?

Tekmaven Jul 18th, 2004 11:28 pm
Re: Enter doesn't execute button.click
 
Quote:

Originally Posted by slade
As always tekmaven you were helpful, that control is awesome. Where do you find out about all of them?


Just about every employee that works on .NET at Microsoft has blogs. Just get a good RSS agregator, and check them all. With a little time each day (okay, maybe a lot), I guaruntee you will learn a lot.

And, the thanks for the kind words. Don't forget to share that thought with the member rating system ("reputation").. ;) .


All times are GMT -4. The time now is 8:36 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC