Re: when i press enter, logoff button is pressed

Discussion in 'ASP .Net' started by Cowboy \(Gregory A. Beamer\), Jan 27, 2009.

  1. Logoff is the default button. You can set another button, if you wish, to
    avoid this. It can be done by setting the DefaultButton of a container
    control. You can also do it programatically in a couple of ways.

    1. Set Attribute on control - crude and a bit kludgy on a button, but useful
    on a textbox

    txtPropertyNo.Attributes.Add("onKeyPress", "javascript:if (event.keyCode ==
    13) __doPostBack('" + btnDisplayGraph.UniqueID + "',")");

    2. Set __EVENTTARGET for the Page object

    Page.RegisterHiddenField("__EVENTTARGET", "NameOfButton");

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

    Blog:
    http://feeds.feedburner.com/GregoryBeamer

    *************************************************
    | Think outside the box! |
    *************************************************
    "Christiano Donke" <> wrote in message
    news:%...
    > can someone help me with this???
    >
    > when i press enter, even if in a blank page, the system logs off...
    >
    > the logoff button tab index is set to 30009...
    > the ogoff button comes from an ASCX...
    >
    >
    > what can be causing this??
    >
    >
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Jan 27, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timothy V
    Replies:
    1
    Views:
    2,212
    Craig Deelsnyder
    Jul 21, 2004
  2. =?Utf-8?B?RGlmZmlkZW50?=

    button click event when keyboard's enter key is pressed

    =?Utf-8?B?RGlmZmlkZW50?=, Dec 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,857
    Steve C. Orr [MVP, MCSD]
    Dec 20, 2004
  3. Frank
    Replies:
    2
    Views:
    689
    Frank Dux
    Jan 13, 2005
  4. Rune
    Replies:
    6
    Views:
    1,289
    Richie Hindle
    Jan 29, 2004
  5. vinaypatangay
    Replies:
    0
    Views:
    466
    vinaypatangay
    Oct 26, 2007
Loading...

Share This Page