[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Harrison

1/4/2003 5:02:00 PM

All,

Anyone could help me to change the "type" attribute of the
button server side control from the default value "submit"
to "button". I tried to use the following code, but no
luck:

MyButton.Attributes["type"] = "button";

Why I want to change the attribute is:

If a web form has editbox and button controls, whenever
you hit enter key inside the editbox, the button control
is click. I like nothing happens when the enter key is hit.

Thanks a lot.
Harrison
2 Answers

Jesse Ezell

1/4/2003 9:13:00 PM

0

This is because your submit button is the default button
on the page. Try using Javascript to set the variable
__EVENTTARGET to null or to another object's ClientID.

--Jesse

Harrison

1/5/2003 12:21:00 AM

0

Thanks you for the information a lot...

sorry, I am new to ASP.NET programming. Could you give me
a little bit details regarding this solution? It seems you
are quite capable, could you also let me know how to
intercept the button click event? In other words, when
user clicks a button, a client side javascript confirm
function is called first. If user chooses "cancel", no
post back at all.

Thanks again.


>-----Original Message-----
>This is because your submit button is the default button
>on the page. Try using Javascript to set the variable
>__EVENTTARGET to null or to another object's ClientID.
>
>--Jesse
>.
>