Postback problems

J

jediknight

Hi

I am very new to asp.net 2.0 as I come from a windows development
background.

I have developed a small user control which has a couple of
textfields. One of the textfield requires that when then return key be
pressed, some validation and database queries are made. For this I
have added the text_changed handler. This works fine. I have also
added a delegate and raised an event when the return key is pressed.

In my webform, I have added the user web control to a panel which also
has some other controls and added the handler to my custom event.

The webform also has a Save button.

The problem I am having is that, when ever I hit the return key in my
user control, the event is raised correctly but then the Save_Click
event is called.

Can I stop this Save_Click event from occuring?
 
S

Steve

Look at the HTML for your form, specifically the <form> tag. If you have
a "defaultbutton" attribute set to your save button, this behavior can
happen. If so, just remove the defaultbutton attribute.



Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 

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

Top