Solved

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

Posted on 2009-05-18
2
508 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

734 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