Basic question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gralet

    Basic question

    Hi,
    How can I make a default button in asp.net for a web form? (when I press
    ENTER it calls the event click of the button) thnks.
    --
    _______________ ___
    Luis Graillet Ramos
  • Alex D.

    #2
    Re: Basic question

    <body>

    <form id="form1" runat="server" defaultbutton=" Button1">



    "gralet" <gralet@discuss ions.microsoft. com> wrote in message
    news:57DBEA00-155F-4D68-8C79-9B1EAA5EA6E8@mi crosoft.com...[color=blue]
    > Hi,
    > How can I make a default button in asp.net for a web form? (when I press
    > ENTER it calls the event click of the button) thnks.
    > --
    > _______________ ___
    > Luis Graillet Ramos[/color]


    Comment

    • Kevin Spencer

      #3
      Re: Basic question

      That would be the Submit button. However, unless the cursor is in a form
      field, it will not be fired. To do that, you would have to handle the
      KeyDown event for the document object in the HTML DOM.

      --
      HTH,

      Kevin Spencer
      Microsoft MVP
      ..Net Developer
      We got a sick zebra a hat,
      you ultimate tuna.


      "gralet" <gralet@discuss ions.microsoft. com> wrote in message
      news:57DBEA00-155F-4D68-8C79-9B1EAA5EA6E8@mi crosoft.com...[color=blue]
      > Hi,
      > How can I make a default button in asp.net for a web form? (when I press
      > ENTER it calls the event click of the button) thnks.
      > --
      > _______________ ___
      > Luis Graillet Ramos[/color]


      Comment

      • Alex D.

        #4
        Re: Basic question

        thats correct. though normally you need to submit the page after entering
        some data in a form field, so the cursor or focus will be in a form field
        most of the time.

        "Kevin Spencer" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
        news:uNgDlAbLGH A.1028@TK2MSFTN GP11.phx.gbl...[color=blue]
        > That would be the Submit button. However, unless the cursor is in a form
        > field, it will not be fired. To do that, you would have to handle the
        > KeyDown event for the document object in the HTML DOM.
        >
        > --
        > HTH,
        >
        > Kevin Spencer
        > Microsoft MVP
        > .Net Developer
        > We got a sick zebra a hat,
        > you ultimate tuna.
        >
        >
        > "gralet" <gralet@discuss ions.microsoft. com> wrote in message
        > news:57DBEA00-155F-4D68-8C79-9B1EAA5EA6E8@mi crosoft.com...[color=green]
        >> Hi,
        >> How can I make a default button in asp.net for a web form? (when I press
        >> ENTER it calls the event click of the button) thnks.
        >> --
        >> _______________ ___
        >> Luis Graillet Ramos[/color]
        >
        >[/color]


        Comment

        • Kevin Spencer

          #5
          Re: Basic question

          I seem to recall mentioning something about that somewhere...

          --
          HTH,

          Kevin Spencer
          Microsoft MVP
          ..Net Developer
          We got a sick zebra a hat,
          you ultimate tuna.


          "Alex D." <alexware69@hot mail.com> wrote in message
          news:%23FEnZIbL GHA.3196@TK2MSF TNGP09.phx.gbl. ..[color=blue]
          > thats correct. though normally you need to submit the page after entering
          > some data in a form field, so the cursor or focus will be in a form field
          > most of the time.
          >
          > "Kevin Spencer" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
          > news:uNgDlAbLGH A.1028@TK2MSFTN GP11.phx.gbl...[color=green]
          >> That would be the Submit button. However, unless the cursor is in a form
          >> field, it will not be fired. To do that, you would have to handle the
          >> KeyDown event for the document object in the HTML DOM.
          >>
          >> --
          >> HTH,
          >>
          >> Kevin Spencer
          >> Microsoft MVP
          >> .Net Developer
          >> We got a sick zebra a hat,
          >> you ultimate tuna.
          >>
          >>
          >> "gralet" <gralet@discuss ions.microsoft. com> wrote in message
          >> news:57DBEA00-155F-4D68-8C79-9B1EAA5EA6E8@mi crosoft.com...[color=darkred]
          >>> Hi,
          >>> How can I make a default button in asp.net for a web form? (when I press
          >>> ENTER it calls the event click of the button) thnks.
          >>> --
          >>> _______________ ___
          >>> Luis Graillet Ramos[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...