Drag image inside container

Discussion in 'ASP .Net' started by Meelis Lilbok, Oct 21, 2008.

  1. 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
     
    Meelis Lilbok, Oct 21, 2008
    #1
    1. Advertising

  2. Meelis Lilbok

    Rain Guest

    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.



    "Meelis Lilbok" <> wrote in message
    news:...
    > 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
     
    Rain, Jan 19, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vince C.
    Replies:
    1
    Views:
    2,116
    Vince C.
    Jul 1, 2003
  2. wolverine
    Replies:
    2
    Views:
    484
    Marcus Kwok
    Jul 24, 2006
  3. none
    Replies:
    8
    Views:
    423
  4. Meelis Lilbok

    Drag image inside container

    Meelis Lilbok, Oct 21, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    327
  5. 123Jim
    Replies:
    0
    Views:
    160
    123Jim
    May 16, 2011
Loading...

Share This Page