How to get a correct co-ordinate position in aspx(IE)

Posted by Tamilselvantms under ASP.NET on 3/29/2013 | Points: 10 | Views : 819 | Status : [Member] | Replies : 1
Dear All,
Please find the below code:
<html>
<body>
<h3>Thenatureoftheunderlyingelectroniccomponentsdidn'tchangebetweenthesecomputersandmoderncomputersweknowoftoday,butwhatdidchangewasthenumberofcircuitsthatcouldbeputontoasinglemicrochip.Intel'sco-founderGordonMoorepredictedthedoublingofthenumberoftransistoronasinglechipeverytwoyears,whichbecameknownas"Moore'sLaw",andthistrendhasroughlyheldforover30yearsthankstoadvancingmanufacturingprocessesandmicroprocessordesigns.</h3>
<form name="Show">
<table>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
<td>
<input type="text"name="MouseX"value="0"size="4">X<br>
<input type="text"name="MouseY"value="0"size="4">Y<br>
</td>
</tr>
</table>
</form>
<script language="JavaScript1.2">
var IE=document.all?true:false
if(!IE)document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=getMouseXY;
var tempX=0
var tempY=0
function getMouseXY(e){
if(IE){
tempX=event.clientX+document.body.scrollLeft
tempY=event.clientY+document.body.scrollTop
}else{
tempX=e.pageX
tempY=e.pageY
}
if(tempX < 0){tempX=0}
if(tempY < 0){tempY=0}
document.Show.MouseX.value=tempX
document.Show.MouseY.value=tempY
return true
}
</script>
</body>
</html>

Note: Just run in IE(HTML format): getting a x, y co-ordinate in correct position. But, same as run in IE(aspx format) not getting correct x,y position.

How to workout in aspx. Kindly help me.

by
Tamil



Responses

Posted by: Jitendrasoft09 on: 3/31/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Dear,
If you are using asp.net, keep your control to runat equal to server on the web page, plz refer the below link that would be helpful.
http://go4answers.webhost4life.com/Example/xy-coordinates-controls-162391.aspx

Jitendra Kumar
If my post helps you, plz mark as an answer.

Tamilselvantms, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response