Buttons in webpage issue?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi ALL:

I have a webpage, which has two three buttons .

what i wanna to do is that everytime i press Enter from keyboard, it alwasy
fire button1 event in webpage?

Does anyone know how can i control this?

Cheers

Nick
 
Hi,
I have a webpage, which has two three buttons .

what i wanna to do is that everytime i press Enter from keyboard, it alwasy
fire button1 event in webpage?

Does anyone know how can i control this?

Container-controls will have a "DefaultButton"-property. That is, you can
set your form's property accordingly, i.e.:

<form id="form1" runat="server" defaultbutton="cmdClose">
....
<asp:Button ID="cmdClose" ...
....

If you have a panel on your page, you may create a default-button
explicitly for the controls on the panel as well. Searching this NG for
"defaultbutton" should give you more detailed information, if required.

Cheers,
Olaf
 
Thanks , Olaf
it is very helpful information.

now i got following issue. coz i am using master page, so when i write
DefaultButton = "imgbSearch", it got error. the reason is the form tag is
in master page, but the button is at content page.

do you know how i can deal with it?

Cheers

Nick
 
Hi,
now i got following issue. coz i am using master page, so when i write
DefaultButton = "imgbSearch", it got error. the reason is the form tag is
in master page, but the button is at content page.

do you know how i can deal with it?

create a panel-control within your Content-control, i.e.:

<asp:Content ID="cMain" ContentPlaceHolderID="Main" runat="Server">
<asp:Panel ID="pnlBG" runat="server" DefaultButton="cmdMyDefaultButton">
your stuff here ...
</asp:Panel>
</asp:Content>

Cheers,
Olaf
 
Back
Top