Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Passing x, y coords to new window

  Asked By: Richard    Date: Jul 08    Category: Asp.net    Views: 807
  

I've got a page with an ImageButton on it.
When I click it I want to open a new window
and send the X & Y coords from the
ImageButton to the new window. How
can I do this without using Session vars?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Oliver Evans     Answered On: Jul 08

do you need to postback the page? or you can use a client side solution?

 
Answer #2    Answered By: Geb Chalthoum     Answered On: Jul 08

Is there a client-side solution which
will get me the x,y coords of the
mouse position? If there is it would be
better.

 
Answer #3    Answered By: Corey Brown     Answered On: Jul 08

you could get the mouse position, but this is not the same as the one
you get on the image click  (imgbtn.x and imgbtn.y)
one is relative to the image and the other relative to the page

If that works for you then...
in your ImageButton you can try hook to the onclick event and
alert(window.event.x)

[c#]
imgButton.Attributes["onclick"] = "alert(window.event.x)";

 
Answer #4    Answered By: Fred Hicks     Answered On: Jul 08

I've never knew about this!
I can do some arithmetic and
get the same coords as the
ImageButton and I won't even
need to use the ImageButton,
I'll just use Image and do it all
client-side.

 
Didn't find what you were looking for? Find more on Passing x, y coords to new window Or get search suggestion and latest updates.




Tagged: