Multiple asp:Panel controls on a page

G

Guest

Hi,

I have mutliple asp:panel controls on a single page, each with a default
button defined (each default button resides within its respective asp:panel).
All validation controls and buttons within each panel also have separate
ValidationGroups defined. When an asp:Textbox has focus in one of the Panels
and I press the enter key, my validation works great. If I press the enter
key a second time, the first button on the page's onClick event fires. Has
anyone experienced this before? Any suggestions?

Thanks,

Darren
 
C

Cowboy \(Gregory A. Beamer\)

There is nothing to return focus to the last control. You can write a
routine that does this, by setting a variable on OnFocus() that dictates
which control was in focus and the reset focus when the button click event
is fired. It is a bit more work.

NOTE: In general, UI is easier when you can seaprate out concerns rather
than having multiple forms on one page. I realize this is not always
possible, but I have also seen many UIs where it was possible and wsa not
done.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 
G

Guest

You may have misunderstood what I meant. When I said that the control had
focus, I mean the cursor was blinking in that TextBox. When I press the
Enter key, it performs as it should - attempting to submit the form controls
in that panel, first by doing the validation (which fails in this test, on
purpose). So my validation summary comes up displaying the validation
errors. When I simply hit the Enter key a second time (the cursor is still
blinking in that same TextBox), the OnClick event of the first button
rendered on the page is fired, instead of the one in this panel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top