Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 18th, 2005, 08:22 AM
Authorized User
 
Join Date: Jun 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default tie an asp button


please help----
how do i tie an asp button to the <enter> key ??

 
Old August 20th, 2005, 01:07 AM
Authorized User
 
Join Date: Dec 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have to use client side JavaScript for this.........

        <script language="javascript">
  function KeyDownHandler(btn)
  {
  // process only the Enter key
  if (event.keyCode == 13)
  {
  // cancel the default submit
  event.returnValue=false;
  event.cancel = true;
  // submit the form by programmatically clicking the specified button
  btn.click();
  }
  }
        </script>

Code for a control that refers the JavaScript
<asp:textbox id="txtWhID" onkeydown="KeyDownHandlerton(btnSearch)" Enabled="true" Width="80px" Runat="server"
EnableViewState="false"></asp:textbox>

Button Control used to tie to the <enter> key
<asp:button id="btnSearch" Width="108px" Runat="server" Height="24px" BackColor="#E0E0E0" Text="Search >>"
Font-Size="Smaller" BorderColor="" ToolTip="Click to Get the Receipts Requiring Reconciliation" CausesValidation="False">

HTH





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to tie to nested GridView inside DataList rsearing ASP.NET 2.0 Basics 6 June 18th, 2011 06:35 AM
How to tie into controls on a MasterPage? rsearing ASP.NET 2.0 Basics 14 July 5th, 2007 01:22 AM
ASP Button Submit netpicker9 ASP.NET 2.0 Basics 0 November 16th, 2006 07:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.