By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,028 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

absolutely positioning user control

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.