Hi,
Try using this, Assuming that we have asp TextBox with an ID of "TextBox1" and Button with an ID of "Button1" controls on our page.
Put this code on the Head of your aspx page.
<script language="javascript">
function doClick(e, buttonid){
var evt = e ? e : window.event;
var bt = document.getElementById(buttonid);
if (bt){
if (evt.keyCode == 13){
bt.click();
return false;
}
}
}
</script>
And this on page load event.
TextBox1.Attributes.Add("onkeypress", "return doClick(event,'" + Button1.ClientID + "')");
Developing Skills. Sharing Skills.
http://www.stringlist.com