.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Absolute positioning

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :ASP.Net
Hi all,I'm having VS 2008 professional. I'm trying to fix absolute positioning for a lable control. In Format menu position is not active when i click on lable? How can I do that or is this option not available in VS 2008?How can I align 2-3 controls as my layout control is not active?How can I use insert layer?Smitha

View Complete Post

More Related Resource Links

positioning elements (relative & absolute divs and floating)




I am finding that when I try to apply the rules for absolute and relative positioning and even float, the results aren't always what I expect.   ( I have divs that are absolutely & relatively positioned as well as floated.)

Is it possible to use relative, absolute and floated elements in a sharepoint 2007 site and have them behave as it would in a non-sharepoint site? I'm trying to determine if it's something I am doing wrong if it doesn't come out correctly. thanks for your input.



Re-positioning an HTML container with javascript onresize with a Master page.


I have an HTML <div> container that I float to the right of a gridview.  When the browser window is maximized, it looks fine.  When minimized, the gridview positions below the floating container and most of the data is pushed off the bottom of the browser - you have to scroll down to see it.

If I position the floating container above the gridview it looks fine in a minimized window, but looks real bad when maximized.

What I want to do is use a javascript: onresize event to re-position the floating container up or down depending on the window.inner.width AND do it with a Master/Content page structure AND do it for only the one page where needed.

I can capture the onresize event and display the window dimensions but haven't figured-out how to do it with a Content page that still uses the Master page.  I think I'm having a very "thick" week...

- Tinker


Wrong root, absolute paths '~' don't work.


Hi guys,

I have some kind of strange problem. I use Visual Studio 2008 Standard Edition, and whenever I use ~ in links (like PostBackUrl = "~/Admin/AddProduct.aspx"),  ~ is translated into "C:\DocumentAndSettings\User\Desktop" instead of my application root. Of course I dont have any project on Desktop. It happens in every project I run , even in project from pendrive which works properly on other computers.

How can i solve this problem ? What and where should i change ? I will be very thankful for any help.


NerdDinner MVC tutorial, map not positioning correctly like completed MVC sample

I have been studying the NerdDinner MVC tutorial for the past week, and I am at step 11 - the part where  adding a Map is introduced.  I have been following the instructions as closely as possible, and I am at the part Integrating the Map with Create and Edit Forms The tutorial runs the sample app at this point and displays how the map should look -- this part being "Host A Dinner".  In the completed sample (which runs correctly for me) the map displays to the right side of the textboxes of Create.aspx, in some kind of container.  But in the sample I am building - per the tutorial - the map displays in the upper left corner of the page, and the container (for the map) displays below the  textboxes on my Create.aspx -- as per the image here:   I tried stepping through the code in the completed sample, but I was not able to see how the map is positioned in the page.  Any suggesions how to fix this problem -- how to position the map correctly on the page -- how to control the positioning of the map -- would be greatly appreciated. Thanks    

Positioning scrollbar

Hi..I have a listview with multiple records inside a div whose overflow property has been set to enable scrollbars.  Now I have another search panel in which If i click on a particular item the corresponding item in the listview gets selected. But the problem is that the item gets selected but the user cannot view it if its way down on the list. I also want the scrollbar to move in order to let the user show the selected item. Any help would be appreciated.Thanks.

Problems Positioning Popup Extender After Postback

Please read this entire post before responding and refer to the supplied screen shots to fully understand the problem. There are multiple layers of Ajax controls invovled. On the main page, I have Modal Popup Extender that displays a User Control. Within the User Control is a Popup Control that displays another User Control. User Control #2 which resides on User Control #1 is comprised of a GridView with sorting capabilities. I've got code in place that displays User Control #1 following a postback generated from within it. I've got additional code that displays User Control #2 (the one with the GridView) following a post back. The result is that when User Control #2 is sorted, it remains visible. The problem is that after the postback for User Control #2 ocurrs, the control is not displayed at the coordinates specified in the markup. If I hide it and then redisplay it, it will appear at the specified location. Protected Sub Page_Load() Handles Me.Load If TextBoxShowCompanyFacilitySelector.Text = "-1" Then Dim PopupControlSelectCompanyFacilityId As Object = FormViewContactDetail.FindControl("PopupControlSelectCompanyFacilityId") PopupControlSelectCompanyFacilityId.Show() End If End Sub These screen shots show the desired and actual behaviors.

Positioning of ComboBox in GridView

I have a need to use the ComboxBox as input for multiple GridView Columns, only the last ComboBox displays correctly, the rest are positioned below the row.  I'm attaching a sample source code using Table instead of GridView, since it has the same problem and will display without needing to bind data.  Adding a position relative div around the Combox placed it in the right position; but when attempting to do a select, placed the item list further down and to the right.  Thanks for any help. I am using VS2010 and AJAX Toolkit version 4.1.40412.0. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Experiment2.aspx.cs" Inherits="Materials_InfoTracking.Experiment2" %><%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title></title></head><body>    <form id="form1" runat="server">        <asp:ScriptManager ID="ScriptManager1" runat="server" />

AutoCompleteExtender positioning problems

Hi all, I can't seem to find an answer to this anywhere so I am trying here. When I don't apply any CSS styles to the properties CompletionListCssClass,  CompletionListItemCssClass and CompletionListHighlightedItemCssClass the completion list displays a nice dropdownlist right below the targeted textbox. However, I am simply looking for a border and a scrollbar after 100 pixels in height (I am allowing 20 items returned). Initially I was using the CompletionListElementID property and pointing it to a DIV placed right below the target textbox. I applied the styles to the DIV (height:100px; overflow:scroll;) and all was well. Even though that produced exactly what I wanted, I noticed that VS 2008 SP1 with .NET 3.5 SP1 was telling me that the CompletionListElementID property is obsolete and I should use the CSS styles. So now I am in a bind because I don't know CSS that well and using some example CSS, that doesn't seem to refer to ANY positioning, the list shows up in odd places...nowhere near the target TextBox. Can anyone tell me what I should do? Can I use the CompletionListElementID property even though I am being warned it is obsolete? It seems to work just fine. I know that I downloaded the latest ToolKit for .NET 3.5 and VS2008 SP1. Thanks for any help...

Other objects moving around when moving an absolute positioned object

Hi, Im working in VWD and currently building a site with html and css. When I try to move some of the objects (DIV, P etc) that ar set with absolute positioning, other objects on the page are moved to the right of my main content div. What am I doing wrong? Thanks Magnus 

CSS Positioning shows as centered in Visual Studio 2008 preview area but off to the left when shown


	background-image: url('images/bodyBG_Home.jpg');
	background-repeat: no-repeat;
	background-color: #BBBBBB;
	margin: auto;
	width: 960px;
	margin: auto;
	width: 960px;
	height: 860px;	

The above code shows how I tried to center the #header and #body elements. When viewed in the preview region of Visual Studio 2008 everything looks perfect. Unfortunately when I view it in the browser both the header div and body div are off significantly to the left.

I have no idea what to do. :(

AjaxToolKit Tab Positioning


I don't know if this is the place to ask this questions..but i have no time to search through the forum title so here u go:

I have set of 10 tabs on my web form. When a new tab load it post back the data of the existing tab as its the need of the system. Now each time a the new tab load there is a flicker and tab positions change. Is there a way to arrange them just like windows tabs so that they all are in one container and get justified everytime i click the new tab. Please let me know if I am not very clear in explaining my problem.

Positioning - Calendar versus ComboBox


I have tripped over the ComboBox positioning problem which seems to get mentioned from time to time on here.

The listbox portion of the ComboBox is appearing a long way to the right and slightly below where I would expect it to be.  The standard answer to that seems to be "well it's inside an absolutely positioned DIV, that's what it does".  I have checked and I don't have any "absolute" positioning at all, although I do have some "relative".

Very close to the ComboBox I have a Calendar.  That is showing its popup exactly where I would expect it to be.  That's set me thinking that the way the toolkit is computing the popup position must be different for Calendar versus ComboBox?!

Any thoughts on how to sort this out would be welcomed!



Outlook & Absolute Links in Format Text Fileds


I have i news list with multiline text field in it.

When item is created an SPD WF brings it to every outlook inbox in company.

Body text includes list`s textfield.

Almost every time news has links to something inside intranet portal.

So my problem is that when people click link from outlook they get link like


And get error of course when opened in internet explorer. It should be absolute address like:


How can i force sharepoint absolute links?

javascript: how to get the "absolute" Date?


Hi all, i was wondering how do we get the current Date using javascript which does not depend on the user's clock. (in other words if the user changes his clock we will still be able to get the correct date).

is this even possible?

sys.extended.UI.PositioningMode.Absolute is null or not an object ,callout ajax control



I'm using  callout ajax control but i'm getting an error "sys.extended.UI.PositioningMode.Absolute"

Any ideas??

Two different widths in absolute positions (VS 2010)



I recently migrated to VS2010. I use absolute position in order to design my web applications. When I place a component (i.e. a TextBox) on a page then I can modify its width by grabbing the left or right side and increase or decrease its width. After that, the html code look like this:

<asp:TextBox ID="TextBox1" runat="server" style="z-index: 1; left: 64px; top: 72px; position: absolute; width: 208px"></asp:TextBox>

There is also another "width" property in the properties window where I can give a specific value. If I do that then the width of the component doesn't change and the html code look like this:

<asp:TextBox ID="TextBox1" runat="server" style="z-index: 1; left: 64px; top: 72px; position: absolute; width: 208px" Width="80px"></asp:TextBox>

If I didn't modify the width by dragging the left or the right side of the component then by changing the width property of the component will actually change the width of the component. But as soon as I drag the left or right side to modify the width, then the second width property doesn't have any impact on the component.

Which of two widths should I use? Is this situation a bug of VS 2010? Is it going to change in the future? Any comments on this is

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend