469,929 Members | 1,696 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Multiple asp:Panel controls on a page

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
Sep 25 '06 #1
2 2221
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!
*************************************************
"Darren Carter" <Da**********@discussions.microsoft.comwrote in message
news:61**********************************@microsof t.com...
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

Sep 26 '06 #2
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.

"Cowboy (Gregory A. Beamer)" wrote:
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!
*************************************************
"Darren Carter" <Da**********@discussions.microsoft.comwrote in message
news:61**********************************@microsof t.com...
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


Sep 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Harry | last post: by
2 posts views Thread by Mark Rae | last post: by
3 posts views Thread by Nathan Sokalski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.