Single TextBox on a Form
-
You are freaking me out here Paul! Just been fiddling with your problem and it is very strange. I can put a hundred buttons, drop downs, text areas, checkboxes, radio buttons and file inputs on the form, but if there is only one text box then the enter key does not fire the default buttons click event. As soon as I put in another text box (not a textmode=multiline either) it then works. So far I have not figured out the why nor does Google bring up anything. Very strange.
Paul Watson
Bluegrass
Cape Town, South AfricaMacbeth muttered: I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er DavidW wrote: You are totally mad. Nice.
Paul Watson wrote: You are freaking me out here Paul! Right! So now you see how I lost my Sunday evening :). I tried everything you have. I'm working on an article about validation controls and figured that I must have done something wrong with those to cause it (it also doesn't trigger client-side validation!). So I broke it down to the simple form I posted in this thread and then built it up to see exactly what it takes to make it work. Then I tried google because I figured it must be a bug and it would be reported everywhere - nothing. Slightly reassuring to hear that it's not something screwy with my computer, but at least then I'd have known what the problem was. X| Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito Song -
Paul Watson wrote: You are freaking me out here Paul! Right! So now you see how I lost my Sunday evening :). I tried everything you have. I'm working on an article about validation controls and figured that I must have done something wrong with those to cause it (it also doesn't trigger client-side validation!). So I broke it down to the simple form I posted in this thread and then built it up to see exactly what it takes to make it work. Then I tried google because I figured it must be a bug and it would be reported everywhere - nothing. Slightly reassuring to hear that it's not something screwy with my computer, but at least then I'd have known what the problem was. X| Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito Songthis is "normal" browser behavior. With only a single textbox and a button, you'll notice that the browser doesn't send the button's key/value pair in the form post data. This is a legacy thing that MS did to emulate netscape way back when they were playing catch-up with NS 3.0 or something. because there is no key-value pair in the form post, there's no way for the framework to know which control caused the post back, and therefore no click events are fired. To get around this issue, I suggest you use my free DefaultButtons[^] control.
-
Here's a strange problem: If I have a web form with just a label, a textbox and a submit button and hit "Enter" in the textbox, it posts back to the server but doesn't perform the MyButton_Click event. If I drop another textbox onto the same form and hit "Enter" in either one of them, it posts back and performs the MyButton_Click event. Can anyone else replicate this problem? The page source doesn't look any different (apart, obviously, from the new textbox), so I have to wonder if this is a .NET Framework bug. But maybe not, maybe it's IE6 SP1 or even something ridiculously simple that I'm doing wrong. Does anyone know anything about this? Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito SongHello, the CPians around the world.;) One possiblity is that this happens the ASP Button texted "Submit". Did you try to change the letter rather than Submit? I guess that the button texted Submit is more closely related to HTML post or get method in the web browser, so this acts as HTML button? That is, ASP button just code <INPUT...> in html format in the client browser, so the web server just considers this is Submit html button. Then, ASP button behavior never happens?:confused: -Masaaki Onishi (eCoolSoft)- ASP.NET Web and Windows Application Development by C# and MFC. eCoolWebPanelBar(BETA) is availabe now. http://www.ecoolsoft.com
-
this is "normal" browser behavior. With only a single textbox and a button, you'll notice that the browser doesn't send the button's key/value pair in the form post data. This is a legacy thing that MS did to emulate netscape way back when they were playing catch-up with NS 3.0 or something. because there is no key-value pair in the form post, there's no way for the framework to know which control caused the post back, and therefore no click events are fired. To get around this issue, I suggest you use my free DefaultButtons[^] control.
Thanks for the info, Andy. I'll save the stream of curse words about what a stupid idea that is :-D. Andy Smith wrote: To get around this issue, I suggest you use my free DefaultButtons[^] control I don't really want to do that as it's for an article and I don't want to detract from the real issue. I might link to it as a possible workaround though. Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito Song -
Hello, the CPians around the world.;) One possiblity is that this happens the ASP Button texted "Submit". Did you try to change the letter rather than Submit? I guess that the button texted Submit is more closely related to HTML post or get method in the web browser, so this acts as HTML button? That is, ASP button just code <INPUT...> in html format in the client browser, so the web server just considers this is Submit html button. Then, ASP button behavior never happens?:confused: -Masaaki Onishi (eCoolSoft)- ASP.NET Web and Windows Application Development by C# and MFC. eCoolWebPanelBar(BETA) is availabe now. http://www.ecoolsoft.com
Masaaki Onishi wrote: One possiblity is that this happens the ASP Button texted "Submit". Interesting idea. Unfortunately, when I first noticed it, the text was still "Button" :) It seems Andy has the right idea. Very frustrating, but right. Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito Song -
Here's a strange problem: If I have a web form with just a label, a textbox and a submit button and hit "Enter" in the textbox, it posts back to the server but doesn't perform the MyButton_Click event. If I drop another textbox onto the same form and hit "Enter" in either one of them, it posts back and performs the MyButton_Click event. Can anyone else replicate this problem? The page source doesn't look any different (apart, obviously, from the new textbox), so I have to wonder if this is a .NET Framework bug. But maybe not, maybe it's IE6 SP1 or even something ridiculously simple that I'm doing wrong. Does anyone know anything about this? Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito SongI get this when the Web Forms designer blatantly delete my events. Just check there. I have to check a page every time I work on it to make sure that half the stuff is not gone before I upload... I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
-
I get this when the Web Forms designer blatantly delete my events. Just check there. I have to check a page every time I work on it to make sure that half the stuff is not gone before I upload... I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
leppie wrote: I get this when the Web Forms designer blatantly delete my events Leppie, dude. It's not like you to answer without reading through the thread first, or at least trying it :) Seems this is actually a browser "feature". As for the designer deleting events, that never happens to me :touching wood:. The closest thing is if you delete the handler name from the properties and there's no code in the handler itself. Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito Song -
leppie wrote: I get this when the Web Forms designer blatantly delete my events Leppie, dude. It's not like you to answer without reading through the thread first, or at least trying it :) Seems this is actually a browser "feature". As for the designer deleting events, that never happens to me :touching wood:. The closest thing is if you delete the handler name from the properties and there's no code in the handler itself. Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito SongPaul Riley wrote: Leppie, dude. It's not like you to answer without reading through the thread first, or at least trying it On the contrary, I usaully just write what I think before reading what others have written :) Bad habit! Just too many things on my mind (math exam on wed, why automake is screwing up my builds in linux, why VS.NET deletes all my code). :laugh: I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
-
leppie wrote: I get this when the Web Forms designer blatantly delete my events Leppie, dude. It's not like you to answer without reading through the thread first, or at least trying it :) Seems this is actually a browser "feature". As for the designer deleting events, that never happens to me :touching wood:. The closest thing is if you delete the handler name from the properties and there's no code in the handler itself. Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito SongOK, I read the post completely and my findings are similar to Pauls. A single textbox just does a postback, quite annoying since what happens if the user clicked the button instead? I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
-
Paul Riley wrote: Leppie, dude. It's not like you to answer without reading through the thread first, or at least trying it On the contrary, I usaully just write what I think before reading what others have written :) Bad habit! Just too many things on my mind (math exam on wed, why automake is screwing up my builds in linux, why VS.NET deletes all my code). :laugh: I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
leppie wrote: On the contrary, I usaully just write what I think before reading what others have written Really? You (usually) do a great job of covering it up. I used to do the same and I consistently made a fool of myself, so I'm trying to stop it now. :-D Paul We all will feed the worms and trees
So don't be shy - Queens of the Stone Age, Mosquito Song