Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

passing the position of a div tag to the server

Posted on 2006-11-24
10
Medium Priority
?
505 Views
Last Modified: 2008-01-09
Is there a simple way of getting the position of a div tag passed to the server so I can save it for later use.
I will be allowing the div to positioned using javascript (I will know the id of the div).

I have one idea of how to do it, but I would like a few suggestions to see if it they are along my line of thoughts.

Thanks

Jetforce
0
Comment
Question by:JetForce
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18018748
Does the <div> element have an ID and a runat="server" attribute?

Bob
0
 

Author Comment

by:JetForce
ID: 18037583
The LearnedOne,
It has indeed.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18037732
C# example:

        HtmlContainerControl div = (HtmlContainerControl)this.FindControl("div1");

Bob
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:JetForce
ID: 18052367
OK
 I understand how to get the control, but how do I get its position on the form, ie top, left etc

Thanks
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18053136
HtmlContainerControl div = (HtmlContainerControl)this.FindControl("div1");
string left = div.Style["LEFT"];
string top = div.Style["TOP"];

Bob
0
 

Author Comment

by:JetForce
ID: 18067903
that is fine, but it does not give me the new position where it has been moved to.

"I will be allowing the div to positioned using javascript!"

I only get the original position

Thanks
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 18067930
If you need to pass a value from client-side JavaScript to server-side code-behind, you could use a hidden element.

Bob
0
 

Author Comment

by:JetForce
ID: 18069148
exactly what I have done, but I was wondering if there was a more elegant way

thanks
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 18069220
If you are looking for a more elegant way, I wouldn't have it.

Bob
0
 

Author Comment

by:JetForce
ID: 18072343
Bob,
  thanks for you help,

Jetforce
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question