Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am using this code to get the coordinates values to my textbox

XML
<asp:ImageButton ID="img1" ImageUrl="~/dance-class-for-kids (1).jpg"
          runat="server" onclick="img1_Click"/>
  </div>
  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>


.cs code is

C#
protected void img1_Click(object sender, ImageClickEventArgs e)
   {
       TextBox1.Text = e.X.ToString()+","+e.Y.ToString();
   }



but i want to display the image coordinates values when i move the mouse on image button image...............plase help me......
[Edit]
Get the mouse coordinate values for image[^]
Update your question here
Posted
Updated 1-Feb-12 1:29am
v2
Comments
Anuja Pawar Indore 1-Feb-12 7:27am    
Why repost? Update your previous question
saravana__ 1-Feb-12 7:29am    
ok....... but i need that code....... u know the code
Anuja Pawar Indore 1-Feb-12 8:01am    
Repost won't help you. You can only request experts for help
Rajesh Anuhya 1-Feb-12 7:48am    
repost..

Please don't post new question update old one

Is this What U Want?

XML
<script type="text/javascript" language="javascript">
       window.onload = function loadw() {

           var b = 0;
           var e = document.getElementById('img1');

           e.onmousemove = function movemouse(e) {

               var tb = document.getElementById('TextBox1');
               var x = e.pageX;
               var Y = e.pageY;
               tb.value = x + "," + Y;
           }
       }

   </script>
 
Share this answer
 
Comments
saravana__ 2-Feb-12 2:41am    
thank you very much......this code is works for me
saravana__ 2-Feb-12 2:46am    
how to display the x and y coordinates in mouse pointer.....please tell me
XML
<script type="text/javascript" src="http://remysharp.com/js/jquery.js"></script>
        <script type="text/javascript" src="http://remysharp.com/downloads/jquery.hint.js"></script>
        <script type="text/javascript" charset="utf-8">
            window.onload = function loadw() {

                var e = document.getElementById('Image1');
                e.onmousemove = function movemouse(e) {

                var tb = document.getElementById('Image1');
                    var x = e.pageX;
                    var Y = e.pageY;


                    tb.title = x + "," + Y;

                    $(function() {

                    $('Image1[title!=""]').hint();
                    });
                }
            }

        </script>

ASP.NET
<asp:image id="Image1" runat="server" height="195px" width="189px" title="" xmlns:asp="#unknown" />
 
Share this answer
 
Comments
saravana__ 2-Feb-12 9:58am    
oh nice............this code is also works for me .....thank you very much....
saravana__ 2-Feb-12 10:32am    
this code is works but i clicked the image button the coordinates values are different in textbox and mouse pointer......how to get the mouse pointer coordinates into textbox.............please help me...........
CRDave1988 3-Feb-12 1:40am    
For textbox look at Solution 1
saravana__ 3-Feb-12 2:30am    
ok...this code display some errors
Validation(XHTML 1.0 Transitional):Element 'image' is not supported......how to solve the problem.....
CRDave1988 3-Feb-12 2:46am    
Can u show me ur code? I may help u

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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