When I click a button on a form ... my code never reaches this onclick event

I have a dropdown and a textbox with a button on a form. When the button is clicked it doesn't go to my onclick even in code, but it goes to my dropdownlist selectedIndexchanged. How can I fix this?

+1


a source to share


4 answers


Does yourLoad_page have a call to change the selected index or items in the DropDownList outside of the check for postback?



+1


a source


I'm not a VB.net person, but try changing the asp button:



 <asp:Button id="btnlookup" Height="24px" Text="LookUp" Width="60px" 
 OnClick="btnlookup_Click" runat="server"/>

      

+4


a source


Make sure the event handler is handling the correct control, or the button tag is referencing the correct method on it on the onclick element.

0


a source


If your dropdown is not set to autoplay and you change its value before clicking the button (and triggering the postback), then the dropdown event should appear.

... not that it explains why you are pushing the handler, not firing.

0


a source







All Articles