473,561 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1168
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*********@Ad sorptionProcess Modeling.com> wrote in message
news:QmKpf.5765 7$WH.5596@duker ead01...
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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:Oq******** ******@TK2MSFTN GP12.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*********@Ad sorptionProcess Modeling.com> wrote in message
news:QmKpf.5765 7$WH.5596@duker ead01...
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.Ad d? 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
2216
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 best result only. Can anyone suggest a simple amendment to the following that will result in only the best result being displayed?
136
9246
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 code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to...
20
11291
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 expressions and I sure there is a lot ways, but I need realy efficient one
3
3990
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 Scores tables. When I want to list of the best scores/ranking, I just do:
5
1805
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 Woods
10
3426
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 somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net...
10
2970
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? public class MyClass private _variableName as integer public property VariableName as integer
4
1831
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 logged in, on each and every page, and redirects the user to a login page if s/he's not logged in. The login page will also take care of some...
24
2175
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 the UI layer to a method in a library class that calls the stored procedure. Best to return a boolean indicating success/failure, return a string with...
11
4671
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 Table Structure: Create Table TestPfx
0
7637
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7558
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8072
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5462
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5177
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3609
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
884
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.