Results 1 to 8 of 8

Thread: default button

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    default button

    Hi,
    When i am in a text box in my webform and i press enter i want it to be the same as clicking the search button. Does anybody know how to set what the default button is?

    Cheers
    Nick
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    Hi,

    I'm not sure if you're interested in using 3rd Party controls but i've used another of their controls and had no problems with it.

    A control is available for assigning default buttons to various controls have a look at Metabuilders if you're interested.

  3. #3
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: default button

    I am using .net 1.1 and wondering if there are any other solution then Metabuilders. Trying to stay away from javascript, or is that the only option other then moving to the 2.0 framework?

  4. #4
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: default button

    You could run with trapping which key was pressed in the text box... not sure how that works with web pages, though. The 2.0 solution is a panel with the default button defined as your search button. I don't know if 1.1 supported that, but it might be worth looking into.

  5. #5
    Addicted Member
    Join Date
    Jul 2005
    Posts
    194

    Re: default button

    in the page load event:

    Page.Form.DefaultButton = btnSend.UniqueID;

  6. #6
    Hyperactive Member kayos's Avatar
    Join Date
    Apr 2004
    Location
    Largo, Florida
    Posts
    306

    Re: default button

    if you are using 2005 you can also set it right in your form tag like so:

    <form id="form1" runat="server" DefaultButton="SearchButton">


    If this post helps, please RATE MY POST!

    Using Visual Studio 2005 SE

  7. #7
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: default button

    I will have to try the code 24sharon has provided in 1.1 and see if that works.

  8. #8
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: default button

    Quote Originally Posted by lleemon
    I will have to try the code 24sharon has provided in 1.1 and see if that works.
    Alas that is 2.0 too.

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