473,414 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How to place web user controls in the correct position?

Hi, friends,

This drove me nuts:

I had two web user controls: header.ascx and copyright.ascx. I planed to put
them on each .aspx pages: Header on the top, and Copyright at the bottom.

However, I could NOT place them in the correct positions of the .aspx
pages. The header.ascx, copyright.ascx, and contents of .aspx kept OVERLAP
each other. For example, in the following .aspx, the two web user controls
and .aspx table overlap together.

<%@ Register TagPrefix="uc1" TagName="Copyright"
Src="../Control/Copyright.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="../Control/Header.ascx" %>
<%@ Page language="c#" Codebehind="NewUser.aspx.cs" AutoEventWireup="false"
Inherits="mesc4u.Management.NewUserGeneral" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>New User</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<uc1:Header id="Header1" runat="server"></uc1:Header>
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute;
TOP: 64px" cellSpacing="1"
cellPadding="1" width="100%" border="1">
<TR>
<TD>asdfasd</TD>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD style="HEIGHT: 27px">asdf</TD>
<TD style="HEIGHT: 27px"></TD>
<TD style="HEIGHT: 27px"></TD>
</TR>
<TR>
<TD>asdf</TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
<uc1:Copyright id="Copyright1" runat="server"></uc1:Copyright>
</body>
</HTML>

I believe that using user control to replace <include> was a good idea. But,
if it did not work in asp.net, I would rather use other approaches.

Any ideas, reference papers? Thanks a lot.

Nov 19 '05 #1
1 1773
Try it without grid layout and without absolute positioning.
Tables and absolute positioning don't get along very well.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
Hi, friends,

This drove me nuts:

I had two web user controls: header.ascx and copyright.ascx. I planed to put
them on each .aspx pages: Header on the top, and Copyright at the bottom.

However, I could NOT place them in the correct positions of the .aspx
pages. The header.ascx, copyright.ascx, and contents of .aspx kept OVERLAP
each other. For example, in the following .aspx, the two web user controls
and .aspx table overlap together.

<%@ Register TagPrefix="uc1" TagName="Copyright"
Src="../Control/Copyright.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="../Control/Header.ascx" %>
<%@ Page language="c#" Codebehind="NewUser.aspx.cs" AutoEventWireup="false"
Inherits="mesc4u.Management.NewUserGeneral" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>New User</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<uc1:Header id="Header1" runat="server"></uc1:Header>
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute;
TOP: 64px" cellSpacing="1"
cellPadding="1" width="100%" border="1">
<TR>
<TD>asdfasd</TD>
<TD></TD>
<TD></TD>
</TR>
<TR>
<TD style="HEIGHT: 27px">asdf</TD>
<TD style="HEIGHT: 27px"></TD>
<TD style="HEIGHT: 27px"></TD>
</TR>
<TR>
<TD>asdf</TD>
<TD></TD>
<TD></TD>
</TR>
</TABLE>
<uc1:Copyright id="Copyright1" runat="server"></uc1:Copyright>
</body>
</HTML>

I believe that using user control to replace <include> was a good idea. But,
if it did not work in asp.net, I would rather use other approaches.

Any ideas, reference papers? Thanks a lot.

Nov 19 '05 #2

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

Similar topics

10
by: Charles Law | last post by:
I have a user control created on the main thread. Let's say, for arguments sake, that it has a single property that maintains a private variable. If I want to set that property from a worker...
1
by: .Net Newbie | last post by:
I am relatively new to .Net and have been coding an intranet site for my employer for a couple of months. I am currently stuck coding in a text-editor called EditPlus without access to the VS.Net...
2
by: David K. | last post by:
My question concerns C# Windows Forms user controls. I have created navigation user control. It gets the parent control's CurrencyManager to its bindable property. In the control, any change in...
11
by: Lloyd Sheen | last post by:
Is there any one who has actually done this. I have now scanned more web articles about this with the realization that not one of them (including MSDN docs) outlines how to do this. This is...
5
by: Henke | last post by:
Hi! I add some web user controls dynamicly with: myPanel.Controls.Add(Page.LoadControl("MyDynamiclyAddedPage.ascx")); the style of the controls on the user control is set from a css-class, by...
12
by: CLEAR-RCIC | last post by:
Hi, I'm having problems setting focus to a textbox on a web user contol on an asp.net web page. The following script works on normal asp.net pages: <script language="javascript"> function...
3
by: Dave | last post by:
I am designing a web page using VS2003 ASP.NET. The page contains various DIVs (panels), one of which is in grid layout. The controls in this DIV render correctly in IE, but when using Firefox they...
1
by: namewitheldbyrequest | last post by:
When I create a web form in VS 2005 I have a problem. I created a MasterPage with a ContentPlaceHolder object on it. Then I created a detail page that refrenced the Master Page. When I drag...
0
by: nicomp | last post by:
When I create a web form in VS 2005 I have a problem. I created a MasterPage with a ContentPlaceHolder object on it. Then I created a detail page that refrenced the Master Page. When I drag...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.