这应该使用客户端脚本(javascript/vbscript)来实现,vb.net目前还只能用在服务器端,你能忍受每按一次上下键就提交一次的速度吗?
解决方案 »
- 转发给粉丝 这个功能是怎么设计的?
- 求一种方法
- gridview 控件中删除access 数据库中记录失败
- DropDownList查询如何写?
- epeater 嵌套 repeater 中子repeater 的控件操作事件
- 问:如何用asp.net用向局域网的共享目录上传文件?
- 一个难题,在线等 !!!
- 实现从日历输入日期的javascript在html下正常,在aspx下就出错?
- session cookies 及页面缓存
- 简单问题求教
- datatable中Columns的expression的问题
- 如何在EditItemTemplate中用FindControl找到DropDownList(解决了直接给钱)
{
//alert(field.id);
xs=document.frmInventory1.kxs.value;
xe=document.frmInventory1.kxe.value;
xk=document.frmInventory1.kxk.value;
ys=document.frmInventory1.kys.value;
ye=document.frmInventory1.kye.value;
yk=document.frmInventory1.kyk.value;
var x,y,strcode;
mid =field.id;
strx=mid.substr(1,4);
stry=mid.substr(5,4);
if(event.keyCode==37)//左
{
y=(parseFloat(stry)/100 - parseFloat(yk))*100;
if(y==(parseFloat(ys)-parseFloat(yk))*100)
{
strcode=mid;
}
else
{
if(y.toString().length==1)
{
strcode="p"+strx+"000"+y.toString();
}
else if(y.toString().length==2)
{
strcode="p"+strx+"00"+y.toString();
}
else if(y.toString().length==3)
{
strcode="p"+strx+"0"+y.toString();
}
else
{
strcode="p"+strx+y.toString();
}
}
}
else if(event.keyCode==38) //上
{
x=(parseFloat(strx)/100 - parseFloat(xk))*100;
if(x==(parseFloat(xs)-parseFloat(xk))*100)
{
strcode=mid;
}
else
{
if(x.toString().length==1)
{
strcode="p"+"000"+x.toString()+stry;
}
else if(x.toString().length==2)
{
strcode="p"+"00"+x.toString()+stry;
}
else if(x.toString().length==3)
{
strcode="p"+"0"+x.toString()+stry;
}
else
{
strcode="p"+strx+y.toString();
}
}
}
else if(event.keyCode==39) //右
{
y=(parseFloat(stry)/100 + parseFloat(yk))*100;
if(y==(parseFloat(ye)+parseFloat(yk))*100)
{
strcode=mid;
}
else
{
if(y.toString().length==1)
{
strcode="p"+strx+"000"+y.toString();
}
else if(y.toString().length==2)
{
strcode="p"+strx+"00"+y.toString();
}
else if(y.toString().length==3)
{
strcode="p"+strx+"0"+y.toString();
}
else
{
strcode="p"+strx+y.toString();
}
}
}
else if(event.keyCode==40) //下
{
x=(parseFloat(strx)/100 + parseFloat(xk))*100;
if(x==(parseFloat(xe)+parseFloat(xk))*100)
{
strcode=mid;
}
else
{
if(x.toString().length==1)
{
strcode="p"+"000"+x.toString()+stry;
}
else if(x.toString().length==2)
{
strcode="p"+"00"+x.toString()+stry;
}
else if(x.toString().length==3)
{
strcode="p"+"0"+x.toString()+stry;
}
else
{
strcode="p"+strx+y.toString();
}
}
}
document.frmInventory1[strcode].focus();
}
tb=new TextBox();
tb.ID="p"+this.GetDegreeZ(float.Parse(xs)+k*float.Parse(xk))+this.GetDegreeZ(float.Parse(ys)+j*float.Parse(yk));
tb.Height=System.Web.UI.WebControls.Unit.Pixel(18);
tb.Width=System.Web.UI.WebControls.Unit.Pixel(33);
tb.CssClass="txtBoxRight";
tb.BorderStyle=System.Web.UI.WebControls.BorderStyle.None;
tb.Attributes["onKeyDown"]="inventoryValid(this)";