Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Mouse Position in ASP.NET using JQuery
WhatsApp
Rahul Kumar Saxena
10y
13.3
k
0
2
25
Blog
Below is my code:
<%@ Page Language=
"C#"
AutoEventWireup=
"true"
CodeFile=
"MousePosition.aspx.cs"
Inherits=
"MousePosition"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title>Mouse Position using JQuery
in
Asp .Net</title>
</head>
<script type=
"text/javascript"
src=
"http://code.jquery.com/jquery-1.8.2.js"
></script>
<script type=
"text/javascript"
>
$(
function
() {
$(document).mousemove(
function
(e) {
$(
'#lblMousePosition'
).html(
"X Axis: "
+ e.pageX +
"<br/><br/>"
+
"Y Axis: "
+ e.pageY);
})
})
</script>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<label id=
"lblMousePosition"
style=
"background-color: Red;"
/>
</div>
</form>
</body>
</html>
Now Run The Application:
Image 1
Now move your mouse anywhere on screen.
Image 2
Mouse Position in ASP.NET using jQuery
Up Next
Show And Hide Password Using jQuery In ASP.NET
Ebook Download
View all
Frontend Developer Interview Questions and Answers
Read by 939 people
Download Now!
Learn
View all
Membership not found