473,511 Members | 10,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

absolutely positioning user control

I have a user control that I want to position anywhere I
like on my Web Form. I am able to do so in design time by
adding a style="position:absolute" to the HTML tag of the
user control dragged in from the Solution Explorer

This allowed me to move around the user control in the
Web Form, but it sticks to the top left corner when run
on Internet Explorer

I read that there is some DIV workabout. I read the
following code somewhere, but it didn't help. Note that
the tree control is placed inside a DIV tag (the .ascx
page is also included)

<taken from the .ascx.cs file>
public string Style
{
get
{
// Return the containing Panel control's
style attribute.
return this.Attributes["style"];
}
set
{
// Set the containing Panel control's
style attribute.
this.Attributes["style"] = value;
}
}
Here is the .ascx page

<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="ctrlChartOfAccounts.ascx.cs"
Inherits="JIS.ctrlChartOfAccounts"
TargetSchema="http://schemas.microsoft.com/intellisense/ie
5"%>
<DIV style="WIDTH: 142px; POSITION: absolute; HEIGHT:
100px" ms_positioning="GridLayout">
<iewc:TreeView id="chartOfAccountsTree" style="Z-
INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px"
runat="server" BorderColor="Black"
BackColor="#E0E0E0"></iewc:TreeView>
</DIV>

Nov 18 '05 #1
1 1637
TJS
try here:

microsoft.public.windows.inetexplorer.ie55.program ming.css

"Michelle Stone" <mi********@yahoo.com> wrote in message
news:04****************************@phx.gbl...
I have a user control that I want to position anywhere I
like on my Web Form. I am able to do so in design time by
adding a style="position:absolute" to the HTML tag of the
user control dragged in from the Solution Explorer

This allowed me to move around the user control in the
Web Form, but it sticks to the top left corner when run
on Internet Explorer

I read that there is some DIV workabout. I read the
following code somewhere, but it didn't help. Note that
the tree control is placed inside a DIV tag (the .ascx
page is also included)

<taken from the .ascx.cs file>
public string Style
{
get
{
// Return the containing Panel control's
style attribute.
return this.Attributes["style"];
}
set
{
// Set the containing Panel control's
style attribute.
this.Attributes["style"] = value;
}
}
Here is the .ascx page

<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="ctrlChartOfAccounts.ascx.cs"
Inherits="JIS.ctrlChartOfAccounts"
TargetSchema="http://schemas.microsoft.com/intellisense/ie
5"%>
<DIV style="WIDTH: 142px; POSITION: absolute; HEIGHT:
100px" ms_positioning="GridLayout">
<iewc:TreeView id="chartOfAccountsTree" style="Z-
INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px"
runat="server" BorderColor="Black"
BackColor="#E0E0E0"></iewc:TreeView>
</DIV>

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
32028
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
7
4710
by: Jonas Smithson | last post by:
Hello all, I have an absolute positioned parent div, and nested inside it is an absolute positioned child div -- I mean the div *code* is nested inside, but the child is physically positioned so...
1
2795
by: Charles Harrison Caudill | last post by:
with tables there is a clean and algorithmic way to organize things, but with css which is, once you get it working, much cleaner, I have to tweak and patch and hope and pray and curse before...
3
1436
by: Bill Zack | last post by:
I have an interesting little ASP.NET problem. I have to position and show multiple "frames" in an IE6 browser at run time in a singe ASP.NET page. Each "frame" will contain a couple of...
2
1778
by: Johnson Smith | last post by:
Question is related to ASP.Net and controlling the position of these controls. I am using html table to placce my web controls. I am displaying same datagrid and calendar controls at clicks of...
3
1779
by: John A Grandy | last post by:
on my WebForm, Panel1 is positioned absolutely , with settings for Top , Left , Width , Height ... Panel1 contains various sub-panels: PanelA , PanelB , PanelC ... these sub-panels' content...
1
1051
by: Craig G | last post by:
is there a correct way to do it? at the mo, i just putting the usercontrol within a <div> tag, then setting its absolute position there. which works for me as the control isnt used on any other...
4
1458
by: jason | last post by:
Any way to automatically default all control to absolutely position rather than having to change that settting ?
2
4428
Frinavale
by: Frinavale | last post by:
I've created a ASP.NET control that displays a "book" of schedules. It dynamically displays scheduling times and allows the user to page through the schedules. It also lets the user edit the...
0
7245
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,...
0
7144
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...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7085
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...
0
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5069
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...
0
4741
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...
0
3227
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...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.