473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 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 1161
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: John J | last post by:
I've written the following code into a class to search for and display the results of all races entered (The complete code is in a previous thread). I wish to amend the code so as to display the...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
20
by: hagai26 | last post by:
I am looking for the best and efficient way to replace the first word in a str, like this: "aa to become" -> "/aa/ to become" I know I can use spilt and than join them but I can also use regular...
3
by: Irene | last post by:
Hi all, I have set up a simple VB program (and later on an ASP interface) to manage an Athletics database. I'm using Access 2000. To simplify, I have the Athlets, the Competitions and the...
5
by: l.woods | last post by:
I want your recommendation on which ASP.NET Shopping Cart software I should buy? Best code Best documentation Best support (if needed. I will buying source code, if possible) TIA, Larry...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
10
by: Ren | last post by:
Hi All, I'm still rather new at vb.net and would like to know the proper way to access private varibables in a class. Do I access the variable directly or do I use the public property? ...
4
by: Ned Balzer | last post by:
Hi all, I am pretty new to asp.net; I've done lots of classic asp, but am just beginning to get my mind wrapped around .net. What I'd like to do is include some code that tests if a user is...
24
by: Earl | last post by:
I have all of my data operations in a separate library, so I'm looking for what might be termed "best practices" on a return type from those classes. For example, let's say I send an update from...
11
by: ankitmathur | last post by:
Hi, I'm trying to overcome a situation whereby I have to search through 4-5 columns and produce the results with an order by according to the values matched in these columns. Example: My...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.