Click here to Skip to main content
15,880,543 members

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

Tamilselvan.tms asked:

Open original thread
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.
Tags: ASP.NET

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900