Default Button

  • Thread starter Thread starter steambun
  • Start date Start date
S

steambun

Hi all,

user want to simple enter text into textbox and press enter directly, but
ASP.NET is using server-side , so that "press enter" can't submit the form
as different as standard html form.

can we add a simple javascript for above requirement? Thanks in advanced.
steambun
 
You can wire up a default button:

VB.NET
Page.RegisterHiddenField( "__EVENTTARGET", "btnMain" )

Add semi-colon for C#. Put this in your Page_Load event.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 
Back
Top