Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9121567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:53:30+00:00 2026-06-17T05:53:30+00:00

I’ve created several moveable widgets (DIVs with text, image content) for the page I’m

  • 0

I’ve created several moveable “widgets” (DIVs with text, image content) for the page I’m working on.

The user can currently go on the page and drag the DIVs about, with the new positions being saved in the database on page unload.

On page_load I can retrieve the most recently saved Top and Left CSS values for each moveable DIV, and I want to set each DIV to its respective saved position on the page. (So when a user logs in, the DIVS are in the same position that they last saw them.)

My problem is that setting the top and left styles from the C# code is not affecting the position of the DIVS. Setting other styles, such as background color, etc have been working okay, but setting the position doesn’t do anything.

The Top and Left numbers I am reading from the database are OK, so there are no errors there.

Here is a simple example:

C# Code Behind

  SearchBox.Attributes.Add("style", "top: 111px;");

  SearchBox.Attributes.Add("style", "left: 144px;");

ASPX

<div id="SearchBox" runat="server"  style="position: absolute; width: 157px; z-index: 100; background-image: url('Images/tagsbox.png'); height: 169px;">

text text text text text text text    

</div>

Does anybody have any idea why the position stays the same?

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:53:32+00:00Added an answer on June 17, 2026 at 5:53 am

    Thanks for the responses everyone. I found my answer-

    Using the

    SearchBox.Attributes.Add("style", "left: 144px;");
    

    line was replacing the style code for the SearchBox with “left: 144px;”, rather than adding additional elements to it like I had intended.

    The correct line to use was:

    SearchBox.Style.Add("left", "144px");
    

    which actually adds on style elements rather than replacing them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am using JSon response to parse title,date content and thumbnail images and place
For some reason, after submitting a string like this Jack’s Spindle from a text
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.