Friday 23 August 2013

Button in UpdatePanel requires two / double clicks to fire - ASP.NET

Leave a Comment
Recently in my project i was implement Update panel for my page update the content. but then i found out that my button (inside) update panel need to click 2 times in order for event click to fire. So after do some testingi found the solution.

Here the simple solution to avoid button require double click  for event click to fire :
  1. Check on your page, is there any validator
  2. Set on the validator attribute "Display="Static"
  3. Try again your page, is the problem solved.?

example :


 <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
 ErrorMessage="*"
 ControlToValidate="TextBox4" Display="Static" SetFocusOnError="true">
</asp:RequiredFieldValidator>

Other Thoughts:

Is there any javascript running on the button's client side onclick, onmousedown, onmouseup?Are you dynamically adding this button to the page?Do you set the  CheckBox's AutoPostBack property to True or False? If it is set to true, you might be in the middle of a async postback while you click the button.


By
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

0 comments:

Post a Comment

Subscribe to our newsletter to get the latest updates to your inbox.

Your email address is safe with us!




Founder of developersnote.com, love programming and help others people. Work as Software Developer. Graduated from UiTM and continue study in Software Engineering at UTMSpace. Follow him on Twitter , or Facebook or .



Powered by Blogger.