XY coordinates after clicking a button
Just in case someone interested by this tip.
I have on a page a server image button linked to a click event. This button has indeed two different functions, one to go back to the homepage, the other to go to another page.
For different reasons, I didn't want to use an image map to make the distinction between my two embedded actions.
The trick I used is quite simple but works well, and should work also with more than 2 buttons.
In the server click event I just test the coordinates using Request.Form("Nameofmybutton.x") for the horizontal position and Request.Form("Nameofmybutton.y") for the vertical position
If CInt(Request.Form("Mybutton.x")) > 83 Then
Response.Redirect("~/Email.aspx")
Else
Response.Redirect("~/Default.aspx")
End If
UPDATE:
I didn't know also that you can use the X or Y argument like this with a server button. Thanks Sergio:
If e.X>83 then ....
Cool ;-)