no default button

P

Peter K

Hi

I have a web-page with many fields/buttons etc.

How do I "unassign" a default-button? That is I do not want any button to
cause a postback if the enter key is pressed. I have seen many websites
which describe how to assign a default-button, and even how to assign a non
visisble button (but even this causes a postback).

How do I stop a page from having a default button at all?

Thanks,
Peter
 
P

Peter K

Peter K said:
How do I stop a page from having a default button at all?

So I suddenly thought of the following:

<asp:panel ID="NoDefaultButtonPanel" DefaultButton="noneB" runat="server">

<asp:Button ID="noneB" runat="server" style="display:none"
OnClientClick="return false" />

<!-- all my other controls -->

</aspPanel>

Seems to work by adding the OnClientClick - which I think supresses the
postback.

Thanks,
Peter
 
G

Gregory A. Beamer

Hi

I have a web-page with many fields/buttons etc.

How do I "unassign" a default-button? That is I do not want any button
to cause a postback if the enter key is pressed. I have seen many
websites which describe how to assign a default-button, and even how
to assign a non visisble button (but even this causes a postback).

How do I stop a page from having a default button at all?

Thanks,
Peter

I see you have an option, but here is a bit more info. It is also
achievable on the entire form with a bit of JavaScript. Test for enter
and return false on the form.

Peace and Grace,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top