1.在网页上添加一个空白的ASPxTextBox控件
<dxe:ASPxTextBox ID="txt_Name" Width="1" runat="server" ReadOnly="true" Border-BorderStyle="None">
</dxe:ASPxTextBox>
2.设置焦点在PageInit事件加入
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.txt_Name.Focus();
}
}
3.在aspx页面加入一段Script:
<script type="text/javascript">
function $(s) {
return document.getElementById(s) ? document.getElementById(s) : s;
}
function keydown(e) {
if (e.keyCode == 27) { parent.ClosePopupCtr(); }
}
document.onkeydown = keydown;
</script>