Click here to Skip to main content
15,900,818 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i submit my page by pressing enter button directly?
I entered username and password, and pressed enter. it is not working.
It is working only by clicking or pressing Tab and Enter...
It is a c# window application..
Posted
Updated 21-Mar-10 19:35pm
v2

You need to add "DefaultButton" property for the page.

ASP.NET 2.0 introduces a wonderful work around for your issue. By simply specifying the "defaultbutton" property to the ID of the <asp:Button>, whose event you want to fire, your job is done.
The defaultbutton property can be specified at the Form level in the form tag as well as at panel level in the <asp:panel> definition tag. The form level setting is overridden when specified at the panel level, for those controls that are inside the panel

Sample example:
<form id="Form1"
    defaultbutton="SubmitButton"
    defaultfocus="TextBox1"
    runat="server">
 
Share this answer
 
v2
try this control instead of using button

<input type="Sumit" value="OK" name="but1" onclick="But1_Click()">

hope it will help you


if you get the answer then rating me

thanks

DX-ARMY
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900