473,657 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
ValidationGroup s 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 2362
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**********@d iscussions.micr osoft.comwrote in message
news:61******** *************** ***********@mic rosoft.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
ValidationGroup s 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**********@d iscussions.micr osoft.comwrote in message
news:61******** *************** ***********@mic rosoft.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
ValidationGroup s 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
1700
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 automatically entered into a SQL database. Problem is, when the user presses the next button on the first panel,
3
1885
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 the second panel, it triggers the script to send the form details by email.
2
5420
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 usercontrols area loaded, they're returned as PartialCachingControls. The UniqueID of the PartialCachingControl is first assigned, when it is added to the controls collection of the parent control. This is where I'm getting an error.
2
6017
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 Visible=False> ....controls </asp:Panel> the panel is not actually created. I'd like it to be created but be
0
1405
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 will require an unknown number of controls (always at least one) to be parsed from the string... after which I inject the resulting HTML into a PlaceHolder control (see code below). In my testing, it appears that ParseControl will successfully...
3
2781
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 System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +201 System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +263
0
2648
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. After adding the following code What I see is that its fine on IE 6 & 7 but on firefox and netscape the 2 links given below shift to the center.
2
2476
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 Visual Studio .NET 2005's Design View always hides the <tr>'s regardless of whether the ASP:Panel's Visible property is set to True, False, or not set at all. Is there some way I can stop Visual Studio .NET 2005's Design View from hiding my <tr>'s...
6
11254
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 when the page is run. can someone please help me My code is below. i am using master pages <asp:Panel ID="MessagePanel" runat="server" Style="z-index: 100; left: 50%; position: absolute; top: 50%;" Visible="False" CssClass="modalPopup"...
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8723
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8502
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.