.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

UpdatePanel, Default Button and Firefox

Posted By:Virendra Dugar       Posted Date: November 29, 2009    Points: 25    Category: ASP.NET    URL: http://www.dotnetspark.com  
 

ASP.Net 2.0 comes up with a new concept called “Default Button” which is one button on the form will work as default button. Whenever we press the enter button default button will be called. 

As for example: In a text box after typing you press enter your default button’s event will be fired. 

However, the one thing that was bothering me with the Default Button is it worked like a charm in IE. In Firefox, it behaved weirdly. The problem wasn’t that it didn’t do a postback. That it did. What it didn’t do was hit the server side event (the button click event). 

When you are selected in any textbox and you press enter, IE will submit this and hit the button click even. However with FireFox, it will only submit – not call the onclick event. 

To solve this add: UseSubmitBehavior="False" to your submit button. Now you can press enter whenever you want in your form and it will do the proper submit regardless of IE or Firefox. 

Enjoy….
 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend