Solved

Enter key does not trigger first button... using ASP.NET & AJAX with UpdatePanel & Master Page with ContentPlaceHolder

Posted on 2009-05-18
2
501 Views
Last Modified: 2012-05-07
I have these pages that are structured as described in the given code. The problem is that when I hit the enter button from a textbox, it goes to my login page, but when I use the mouse to click button1, it performs the corresponding event handler. I want the enter key to trigger button1's click event also. Let me know if you need more info.
masterpage.master

<html>

   <body>

      <form>

         <table>

            <tr>

               <td>

                  <div>

                     <asp:ContentPlaceHolder ID="holdmyplace">

etc
 
 

webpage.aspx

<asp:Content ContentPlaceHolderID="holdmyplace">

   <asp:ScriptManager />

   <div>

      <asp:UpdatePanel>

         <ContentTemplate>

            <table>

               SOME ROWS AND CELLS WITH TEXT BOXES

            </table>

         </ContentTemplate>

         <Triggers>

            <asp:AsyncPostBackTrigger ControlID="button1" EventName="Click" />

            <asp:AsyncPostBackTrigger ControlID="button2" EventName="Click" />

         </Triggers>

      </asp:UpdatePanel>

      <table>

         <tr>

            <td>

               <asp:Button ID="button1" OnClick="button1_click" runat, etc>

               <asp:Button ID="button2" OnClick="button2_click" runat, etc>

etc

Open in new window

0
Comment
Question by:GrandPixel
2 Comments
 
LVL 9

Accepted Solution

by:
cdaly33 earned 125 total points
ID: 24416585
The quickest way I would think is to put a <asp:panel> around the all of code in the content page and set its default button property to button1.
0
 

Author Comment

by:GrandPixel
ID: 24421646
works for me... if there is another way, someone please post... thanks cdaly33
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Syntax error 9 45
Split in Javascript 5 31
Importing CSV file encoded in UTF-8 in SQL SERVER 2008 using BULK INSERT 5 31
Code works but it's slow 24 45
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now