Feb12
The .NET Dilemma
- posted by: John
- no comments
- post a comment
One of my biggest pet peves in .NET, specifically .NET 1.1, is the enter key when it pertains to a web form. Back in the old days, ASP web developers with round sunglasses and lava lamps cluttering their desks had the ability to use multiple form tags on the web page. When users would enter misspelled text into a INPUT box and pierce the enter key with 3 fingers, that form would submit its information to its ACTION destination.
Since Bill Gates invented DataSets, ViewStates, and PostBacks, he removed the need for multiple forms on a page. In .NET 1.1, developers admiring their Thundercats collection and listening to A-HA, tried to have a search box in their page header and a sign-up form below only to wave their fist in the air in vexation. When a user would hit the enter key in the sign-up form, it activated the search button in the page header. What to do? WHAT TO DO!?
Enter ASP.NET 2.0.
Very early in my trek using 2.0, I learned of the DefaultButton attribute in the FORM tag. You can now specify which form button is activated when a user hits the enter key. This is accomplished by a javascript function that gets rendered when the page loads called “WebForm_AutoFocus.” This is great and all but how does this help when I’m trying to mimic multiple web forms?
While coding an ASP:PANEL in Visual Studio Express, I noticed Intellisense give me the option to place a DefaultButton attribute in the panel. WHAT!?! If you incapsalate form sections of your web page with ASP:PANEL’s, you can pay homage to those ASP coders of the past and imitate multiple web forms.
Just keep your users from disabling Javascript…

Leave a comment