473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Text changed vs. click event

I'm writing a small ASP.NET app (written in VB.NET). It starts off with a Login screen

It contains a drop-down box for the username, a textbox for the password and a link button for the sign on

I want to allow the following scenarios
1) Allow the user to press 'enter' on their keyboard after entering the passwor
2) Tab to the 'SignOn' button and press enter
3) Click the button with their mouse

All three should check the validity of the password, if correct redirect to next page, if incorrect, state error message

I am having trouble with the DB access on number 2 & 3 because I have both a PasswordText_Changed event and a Button_Click event. When 2 & 3 are done, both events fire, starting with the passwordtext_changed event. I can fix it by only having a passwordtext_changed event but if I have a button shouldn't I have a click event. But if I only have a click event, number 1 doesn’t fire off an event.

I am new at ASP.NET programming, is there a better solution or am I missing something. These three scenarios seem to be things I am able to do on most public websites as a user

Any input would be appreciated
Thank-you
Barbara Alderto

Nov 20 '05 #1
3 1213
Cor
Barbara,

It is not only what is technical possible in a program (this is something
many programmers forget) but also what behaviour your user expect.

In this case, he/she sees a button to submit, let that button work.

Consistency is very important for a user.

Just my thought about this,

Cor
Nov 20 '05 #2
Thank-you for your thoughts

Maybe its just habit but many websites work this way and I have come to expect it as a user

However, even when trying to just have a click event and let the button work I would still want certain results if the user were to hit enter. Currently if the user hits enter after typing in a password even if he didn't mean to I would want it to do nothing, forcing the user to either tab to the button or click the button. But instead it erases the password and starts over. I have even tried to add a txtpassword_changed event that just changes the focus either to the button or the text box, but it still clears the textbox. How can I get it to do nothing if the user accidentally hits the enter key on their keyboard

Barbar

Nov 20 '05 #3
Cor
Hi Barbera,

I agree with you that I find it also terrible behaviour of webpages.

And this is not consistent, you can when you push Enter one time send, the
other time it cleans and sometimes it does nothing, maybe I find something
for you, but I do not promish it at all.
(And not today anymore).

Cor
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Lance Johnson | last post by:
I would like for when a tab page changes, that my controls on the previous tab page would receive a visiblechanged event or some other event so they are aware of that. We have db locks in some of...
2
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different...
7
by: theyas | last post by:
How can I get my code to NOT display two "Open/Save/Cancel/More Info" dialog boxes when using the "Response.WriteFile" method to download a file to IE I've asked about this before and didn't get a...
1
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new...
1
by: ProgramAnalyst | last post by:
Hey all, I have a label that gets its text from a DB. This text can be changed on the page in a textbox and after the save button is clicked the new text is updated in the DB and the page...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
3
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim...
2
by: jason | last post by:
hello. i am just trying to save a TextBox.Text value to a database, but strangely, when the value is changed on the web form, the changes are not recognized in the event where i try to save the...
8
by: Radek Budaø | last post by:
Hi all, i have trouble with changing text value of textbox on runtime. I use this control to display process information about sending e-mail per smtp. I use external component >>Imports...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.