471,627 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

best way to do draging

I am creating a control (an image) on the server and Adding it to a Panel's
Controls collection. On the client side I want to drag the control to a new
location using the ondrag event to modify the style.top and style.left. On
ondragend the form is submitted. The first problem I am having is that after
the form is submitted the image is gone. This problem can be solved by
having the server sent the image to the client using the Panel's InnerHtml
property. Is there a way to get the control to persist across round trips
when it is added to the Panel using Controls.Add? The second problem is
getting the modifications of the style attribute made by client-side
javascript to persist. Can this be done by setting the right properties
somewhere? Some things seem to persist in the <DIV> without effort like
text. How can an added control be made to persist and how can the
client-side modified style attribute be made to persist.

THANK YOU in advance.

David
Dec 20 '05 #1
2 1120
Hi David,

To have the Control persist, you would have to add it back with each
PostBack.

To have the style information persist, you would have to store that
information somewhere in the page, for example in a hidden form field, when
it changes, then grab the hidden form field's contents on PostBack, and
write a startup script JavaScript that would re-set the style when the page
is returned to the browser.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"David" <Co*********@AdsorptionProcessModeling.com> wrote in message
news:QmKpf.57657$WH.5596@dukeread01...
I am creating a control (an image) on the server and Adding it to a Panel's
Controls collection. On the client side I want to drag the control to a new
location using the ondrag event to modify the style.top and style.left. On
ondragend the form is submitted. The first problem I am having is that
after the form is submitted the image is gone. This problem can be solved
by having the server sent the image to the client using the Panel's
InnerHtml property. Is there a way to get the control to persist across
round trips when it is added to the Panel using Controls.Add? The second
problem is getting the modifications of the style attribute made by
client-side javascript to persist. Can this be done by setting the right
properties somewhere? Some things seem to persist in the <DIV> without
effort like text. How can an added control be made to persist and how can
the client-side modified style attribute be made to persist.

THANK YOU in advance.

David

Dec 20 '05 #2
Thank you. I now know to stop looking for a better way.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:Oq**************@TK2MSFTNGP12.phx.gbl...
Hi David,

To have the Control persist, you would have to add it back with each
PostBack.

To have the style information persist, you would have to store that
information somewhere in the page, for example in a hidden form field,
when it changes, then grab the hidden form field's contents on PostBack,
and write a startup script JavaScript that would re-set the style when the
page is returned to the browser.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"David" <Co*********@AdsorptionProcessModeling.com> wrote in message
news:QmKpf.57657$WH.5596@dukeread01...
I am creating a control (an image) on the server and Adding it to a
Panel's Controls collection. On the client side I want to drag the control
to a new location using the ondrag event to modify the style.top and
style.left. On ondragend the form is submitted. The first problem I am
having is that after the form is submitted the image is gone. This
problem can be solved by having the server sent the image to the client
using the Panel's InnerHtml property. Is there a way to get the control
to persist across round trips when it is added to the Panel using
Controls.Add? The second problem is getting the modifications of the style
attribute made by client-side javascript to persist. Can this be done by
setting the right properties somewhere? Some things seem to persist in the
<DIV> without effort like text. How can an added control be made to
persist and how can the client-side modified style attribute be made to
persist.

THANK YOU in advance.

David


Dec 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by John J | last post: by
136 posts views Thread by Matt Kruse | last post: by
20 posts views Thread by hagai26 | last post: by
5 posts views Thread by l.woods | last post: by
10 posts views Thread by jojobar | last post: by
4 posts views Thread by Ned Balzer | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.