Setting a single button on a panel by default is always a bit complicated. I saved the method in a shared library just for this problem:
public static void EnterOnKeyDown(WebControl targetControl, WebControl controlToPress)
{
targetControl.Attributes.Add("onkeydown",
"if(event.which || event.keyCode){if ((event.which == 13)" +
"|| (event.keyCode == 13)) {document.getElementById('" +
controlToPress.ClientID + "').click();return false;}} else {return true};");
}
You can place this method anywhere and call it like this:
EnterOnKeyDown(someTextBoxInYourPanel, yourSubmitButton);
javascript , .