*.aspXD 的设置
<script language="javascript">
function _onkeypress(control)
{
if (event.keyCode == 13)
{
document.getElementById('<%=LinkButton1.ClientID%>').click();
return false;
}
}
</script>
*.cs文件里面
//回车自动提交
this.shop_address.Attributes.Add("onkeypress","return _onkeypress();");
this.shop_name.Attributes.Add("onkeypress","return _onkeypress();");
this.Flower_Price_DropDownList1.Attributes.Add("onkeypress","return _onkeypress();");
this.flower_type.Attributes.Add("onkeypress","return _onkeypress();");
<script language="javascript">
function _onkeypress(control)
{
if (event.keyCode == 13)
{
document.getElementById('<%=LinkButton1.ClientID%>').click();
return false;
}
}
</script>
*.cs文件里面
//回车自动提交
this.shop_address.Attributes.Add("onkeypress","return _onkeypress();");
this.shop_name.Attributes.Add("onkeypress","return _onkeypress();");
this.Flower_Price_DropDownList1.Attributes.Add("onkeypress","return _onkeypress();");
this.flower_type.Attributes.Add("onkeypress","return _onkeypress();");