Results 1 to 4 of 4

Thread: Default buttons

  1. #1

    Thread Starter
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Question Default buttons

    I expect this has been answered before - but how do I set a button to be 'default' on an ASP.NET page? Do I need to do some Javascript (I have very very very little experience of Javascript) or is there a better way?

    I can't believe M$ released .NET without a default button property...

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  2. #2
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    What do you mean by default button? If you mean what button is clicked when you press enter you must bear in mind that you are dealing with html at the end of the day and an asp.net page cannot behave any differently.
    Pressing enter on an html form will post it back regardless unless of cours you add in some javascript to overide the behaviour but that is beyond the scope of asp.net.

  3. #3

    Thread Starter
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    For example, I have a ASP.NET form with various buttons on it. I want one of them to be the button that is clicked when you press ENTER. At the moment ASP.NET appears to pick whichever one it feels like - there doesn't seem to be anyway to choose it (tab order or anything).

    If I need to use some JavaScript then so be it - can you tell me what I need to do in JavaScript to achieve this.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  4. #4

    Thread Starter
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width