473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 2349
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Harry | last post by:
Hi, Slight problem in asp.net. (c#) I have a asp:panel page set up, with two different panels both of which contain a form. On the second page the user presses submit and the form details are...
3
by: Harry | last post by:
Hi, Can anyone help. I have a asp.net page (c#), with two panels, both of which have asp:textboxes on. When I press the first button, the second panel shows fine. When I press the button in...
2
by: Anders Borum | last post by:
Hello! I'm building pages dynamically, by loading usercontrols recursively and adding the to eachother. My problem is usercontrols - defined with output-caching directives. When these...
2
by: Mark Rae | last post by:
Hi, Is there any way to use the asp:Panel Web control so that it is always created regardless of its Visible property? E.g. if I write the following: <asp:Panel ID=pnlEvent Runat=server...
0
by: PB | last post by:
According to the documentation, ParseControl returns a parsed control from an input string. The documentation seems to assume that *one* control will be parsed from the string. My implementation...
3
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313...
0
by: mahaq | last post by:
Hi Guys, I like to know if there is any better solution to this issue. I am a front end developer using CSS and asp.net technologies I have a .net page and I am using an external CSS file....
2
by: Nathan Sokalski | last post by:
I have an HTML table in which I am using ASP:Panel controls to group together <tr>'s so that I can more easily show/hide them (by setting the ASP:Panel's Visible property). This works fine, but...
6
by: phpmel | last post by:
Hi Guys, I have an asp panel,an associated drag panel extender, a label and an OK button that serves as a message popup. i would like this pop up to show up in the centre of the browser window...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.