Set button as default on web form

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Set button as default on web form

    In article <002b01c34a30$c63dcb50$a601280a@phx.gbl>,
    [email]Michael.Rainey@pnl.gov[/email] says...
    > I need to set one button (out of many) as the default
    > button on the web form when I hit return in a textbox
    > control. This seems like a simple question that should
    > have a simple answer.
    Use "Page.RegisterHiddenField". See this newsgroup post:

    [url]http://tinyurl.com/gwr5[/url]

    --
    Patrick Steele
    Microsoft .NET MVP
    [url]http://weblogs.asp.net/psteele[/url]
    Patrick Steele [MVP] Guest

  2. Similar Questions and Discussions

    1. How do I set the default button on a web page
      On an aspx page, I notice when the page opens there is no default command button (press enter & nothing happens). However, once I set the focus on...
    2. default html button
      Hi everyone, On a html page I have some input boxes and few buttons. On that page if user hits ENTER key at any time, it will have a specific to...
    3. Setting the default button
      hi, i have a webform, which has a couple of formfields including a couple of buttons too. the webform structure is textbox1 button1...
    4. JavaScript Access to Button in form tags (webcontrol or html button)
      Hello, I have a button called LoadBtn, which exists in <form name="Form1" runat=server></form> tags. I then have javascript loaded outside of...
    5. Default button
      How to set the default button(return key) in a WebForm? ..Javier Ros Moreno.
  3. #2

    Default Re: Set button as default on web form

    You can intercept the client side enter keypress event of the text box and
    then click the correct button using javascript code.
    Here's a good example:
    [url]http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18[/url]

    You could also try using this free control.
    [url]http://www.metabuilders.com/tools/DefaultButtons.aspx[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Mike" <Michael.Rainey@pnl.gov> wrote in message
    news:002b01c34a30$c63dcb50$a601280a@phx.gbl...
    > I need to set one button (out of many) as the default
    > button on the web form when I hit return in a textbox
    > control. This seems like a simple question that should
    > have a simple answer.
    >
    > Thank you,
    >
    > Mike

    Steve C. Orr, MCSD Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139