Drag image inside container

  • Thread starter Thread starter Meelis Lilbok
  • Start date Start date
M

Meelis Lilbok

Hi

I have a following question

Lets say we have a Panel and inside that panel a Image control on ASP.NET
web site.

Panel siz is 200x200px

Image size is 400'x400

is'it possible with asp.net ajax to move picture inside panel with mouse?
like google maps for example :)


BR;
Mex
 
Yes.

There are probably many ways this could be done. One quick and dirty way to
do this is to add a button on the form which deletes the picture In the
click event for the button ( server side code behind ). Add this button as a
trigger to your update panel.


<asp:updatepanel..... >
<content>
.....
</content>
<triggers>
<asynchronouspostback controlid='myButton' ..... >
</triggers>

On the pre-render event for the button add the following

myButton.attributres.add("style","display:none");


On the client side. Wire up your javascript to trigger the postback.

onmouseout= "document.getElementById('myButton').click();"


As I say, there are more ways than one to do this, but this is quick way.
 
Back
Top