Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

onkeypress in c#

Posted on 2006-11-30
6
Medium Priority
?
554 Views
Last Modified: 2008-02-01
I have a page like a login page, after the user provide the name and password, then press  enter button, I wish them can go to another page, how can I do that?

Thanks

lyha
0
Comment
Question by:lyha_zm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Expert Comment

by:kraffay
ID: 18047366
Try this:

    protected void btnLogin_Click(object sender, EventArgs e)
    {
           
        Response.Redirect ("MyPage.aspx");
       
    }

Make sure your button calls the sub:

<asp:Button ID="btnLogin" runat="server" OnClick="btnLogin_Click" Text="Button" />
0
 

Author Comment

by:lyha_zm
ID: 18047395
I have that function, I just want user to press enter key instand of click submit button
0
 
LVL 7

Accepted Solution

by:
vnvk earned 2000 total points
ID: 18047536
http://www.dotnetwatch.com/display.aspx?contID=48
http://www.dotnetwatch.com/ASP.NET.aspx

The above url defines a way to add a new attribute to the text box control.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:kraffay
ID: 18047540
I think you will need to set focus to the button after they enter the password.
0
 
LVL 28

Expert Comment

by:strickdd
ID: 18047775
By default the first <asp:Button> is the "Submit" button and will be executed when the user hits "Enter". What you can do is change preceeding <asp:Button>'s to be <input type="Button" ID="SomeButton" runat="server">
0
 
LVL 15

Expert Comment

by:Solar_Flare
ID: 18050969
you can also put the textbox and button in an asp:panel and set the panels defaultbutton property to be the appropriate button.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question