Solved

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

Posted on 2009-05-18
2
505 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wordpress Security 29 48
Error in Angular 2 when showing in grid 4 25
Change to file doesn't show up 16 54
WordPress: Debugging from my Windows 10 Desktop 6 38
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

829 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