Does anyone know how to get the top and left positions of an ASP.NET WebControl..? I have an aspx page with controls that when clicked on enters a javascript function that looks like:
[CODE=javascript]
function ShowPosition(oC trl)
{
var ctrl = document.getEle mentById("ctrl_ id");
var top = ctrl.style.top;
var left = ctrl.style.left ;
alert(top + ", " + left);
}
[/CODE]
The asp.net tag that calls the javascript function looks like:
[code=html]
<asp:textbox id="ctrl_id" runat="server" onclick="ShowPo sition(this);"> </asp:textbox>[/code]
But this doesn't work. Please help.
[CODE=javascript]
function ShowPosition(oC trl)
{
var ctrl = document.getEle mentById("ctrl_ id");
var top = ctrl.style.top;
var left = ctrl.style.left ;
alert(top + ", " + left);
}
[/CODE]
The asp.net tag that calls the javascript function looks like:
[code=html]
<asp:textbox id="ctrl_id" runat="server" onclick="ShowPo sition(this);"> </asp:textbox>[/code]
But this doesn't work. Please help.
Comment