|
-
Sep 1st, 2006, 04:56 PM
#1
Thread Starter
Junior Member
When user presses enter...
Ok im having a problem that seems so simple, but i am just unable to find an answer by searching...
Basically what im trying to do is make it so when the user presses enter on the keyboard it presses a certain button on the page. For Example: The user types in their username and password and presses enter, this clicks the "login" button rather than multiple other buttons on the webform. The answer to this would solve half of my problem.
The other half is, i need to click a link in the datagrid when the user presses enter, for example: The user clicks edit, then starts typing in the textbox they need edited, when they are done most users will probably hit the enter key so i would like this to click the Update link in the datagrid, or the alternative of just doing nothing, if clicking update is not possible or very difficult.
I am using VS 2003, C# Webform
-
Sep 1st, 2006, 05:29 PM
#2
Hyperactive Member
Re: When user presses enter...
You could set a event handler on the keys, and when the user click the enter key, simply call the method for the event handler as of the button.
-
Sep 1st, 2006, 06:25 PM
#3
Re: When user presses enter...
I guess it's the "DefaultButton" property
HTML Code:
<form id="form1" runat="server" defaultbutton="Button1">
Last edited by ComputerJy; Sep 1st, 2006 at 06:32 PM.
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Sep 1st, 2006, 06:27 PM
#4
Thread Starter
Junior Member
Re: When user presses enter...
I dont think that works for a webform, because there is nothing close to that in the properties window 
also... is that vs 2005?
-
Sep 1st, 2006, 06:34 PM
#5
Re: When user presses enter...
sorry, didn't read your entire post
updated
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Sep 1st, 2006, 06:57 PM
#6
Hyperactive Member
Re: When user presses enter...
sorry, didnt see it was a webform - jen
-
Sep 1st, 2006, 07:11 PM
#7
Thread Starter
Junior Member
Re: When user presses enter...
kewl ill try that out on tuesday when i get back in the office, thx guyz
-
Sep 2nd, 2006, 12:16 AM
#8
Re: When user presses enter...
WebForms questions go in the ASP.NET forum.
The submit button is the default. That is all that the DefaultButton property controls.
-
Sep 5th, 2006, 10:01 AM
#9
Thread Starter
Junior Member
Re: When user presses enter...
welp, turns out i dont have that option for "defaultbutton="Button1""
-
Sep 5th, 2006, 12:19 PM
#10
Re: When user presses enter...
 Originally Posted by HardD99
welp, turns out i dont have that option for "defaultbutton="Button1"" 
Sorry, it seems to be a new feature in v2.0 that doesn't exist in 1.1
I guess you'll have to go JenniferBabe's way
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|