protected void lbkShowWork_Click(object sender, EventArgs e)
{
}
How do I get the position of the mouse when I click the LinkButton?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer: you can’t. ASP.NET WebForm’s events are an abstraction on top of the HTTP
<form>POST action. Web browsers don’t submit the coordinates of the cursor.Long answer: it’s possible, using a variety of means depending on your scenario. The “easiest” way is to use a framework like jQuery and handle client-side mouse-click events for every element on the page, when the mouse is clicked you intercept the form’s
onsubmitaction and update an<input type="hidden" />with the coordinates and then let the form submission continue.…or use an
<input type="image" />which includes the coordinates when submitted http://dev.w3.org/html5/markup/input.image.htmlOf course, your code makes an assumption that the user is using a mouse to begin with. There are other web user-agents that don’t have pointing devices, like smartphones, touch-tablets, and spiders.