Drag image inside container

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
 
R

Rain

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top