Geeks With Blogs


Locations of visitors to this page

View ► Sanjay Uttam []'s profile on LinkedIn

Add to Google Reader or Homepage

Sanjay Uttam Predominantly .NET
UPDATE: If you're looking for the solution that will work in FireFox & IE...Go here

Okay, I admit, this is yet another post so I know where to go in 3 months when I totally forget this day. 

Long story short: I was trying to use the DefaultButton property on a panel in order to get a button clicked by default when a user hits enter on my search form.  I was using an ImageButton, and surprise! That won't freakin' work!  Seriously...try it. 

I came across a post on here ( ) from S. Justin Gengo. With a link to his site....

And booya, his simple JS code works perfectly in IE6/7 & FF. 

Good day, sir.

ps - Thank you Justin

 tbSearchBox.Attributes.Add("onkeydown", _
    "javascript:if((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)){document.getElementById('" _
    & btnSearchButton.ClientID & "').click();return false;}else return true;") Posted on Thursday, July 31, 2008 3:08 PM C# , VS.NET 2005 , VB.NET | Back to top

Copyright © Sanjay Uttam | Powered by: