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!
***********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top