首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

JavaScript和ASP.NET传值有关问题`

2012-02-27 
JavaScript和ASP.NET传值问题``在线等啊!用JavaScript做了个移动窗体,当固定之后或者我单击一个Button的时

JavaScript和ASP.NET传值问题``在线等啊!
用JavaScript做了个移动窗体,
当固定之后或者我单击一个Button的时候在ASP.NET程序代码里
如何获取到DIV在页面的X.Y坐标值啊!
在线等啊!下面是页面代码




[解决办法]
放在隐藏域里传回去就可以了
aspx:
<input type= "hidden " id= "position " runat= "server " value= " " />

cs:
Button1.Attribute.Add( "onclick ", "document.getElmentById( 'position ').value = document.getElementById( 'divID ').style.left + ', '+document.getElementById( 'divID ').style.top ");

button事件函数里面:
string[] pos = position.Value.Split( ', ');
string x = pos[0];
string y = pos[1];

热点排行
Bad Request.