1 Replies - 12566 Views - Last Post: 01 February 2010 - 04:15 AM Rate Topic: -----

#1 razibulislam   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 01-February 10

TextBox keypress event in ASP.NET

Post icon  Posted 01 February 2010 - 02:53 AM

Hi,
I have a ASP.NET form in where a textbox and a button exists. putting some text in textbox and clicking Button its works. But i want entering value in textbox and pressing 'Enter' will execute the Button code which is possible is C#[text box key press event]. But i didnt get any keypress event in ASP.NET. Only textchanged event exists. In some other Forum i saw they used javascript and their design and code exists on the same file. But in my case i have separated code file because i had to code huge for database connection. I prefer to code separately. Is there any way i can do the task ?

Pls i need the solution asap.

Is This A Good Question/Topic? 0
  • +

Replies To: TextBox keypress event in ASP.NET

#2 RenderYourDream   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 30-January 10

Re: TextBox keypress event in ASP.NET

Posted 01 February 2010 - 04:15 AM

you can use something like
<asp:Panel ID="pnl1" runat="server" defaultbutton="Button1">


which set default event for panel you can set for form also hence when you press enter it execute Event present for Button1
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1