Monday, October 17, 2005

Fustrated, but finally fixed the button focus problem

I was fustrated for a while about how to make the first WebForm button in the form to be OFF focus. The reason is that that first button is the "Logout" button, and the least I want to happen is having the user accidentally hit the return key, trigger the logout button and have all their work destoried.

However, there is no Focus method on ASP.Net 1.1, and setting TabOrder doesn't have at all. After a bunch of trial and error, I finally figured out that I can resolve the problem by user a regular HTML control and set it as server control, and then remove the original ASP.Net button control.

Kind of a messy solution. But, heck, it works.

0 Comments:

Post a Comment

<< Home