My pages look different from machine to machine...

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I'm on my first ASP.Net development..

On my laptop, for example, i have a page with all 4 textboxes aligned and page looks good.

I just looked at it from another co-worker's machine, and the textboxes are not aligned..one was to the right, one to the left...

we both IE.
How can I make my pages look the same from machine to machine??
 
No CSS, This is for example one HTML code. It's not in a table, it's in a Panel. Would that make a differece?? would it be an issue with resolution??

This is the code:
Code:
<HTML>
	<HEAD>
		<title>Incident</title>
		<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
		<meta content="Visual Basic 7.0" 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">
		<form id="Form1" method="post" runat="server">
			<asp:radiobutton id="rbFindIncident" style="Z-INDEX: 101; LEFT: 411px; POSITION: absolute; TOP: 130px" runat="server" GroupName="IncidentRadioButtons" Checked="True" Text="Find Incident" AutoPostBack="True"></asp:radiobutton><asp:radiobutton id="rbAddIncident" style="Z-INDEX: 102; LEFT: 683px; POSITION: absolute; TOP: 130px" runat="server" GroupName="IncidentRadioButtons" Text="Add Incident" AutoPostBack="True"></asp:radiobutton><asp:panel id="pnlFindIncident" style="Z-INDEX: 103; LEFT: 234px; POSITION: absolute; TOP: 198px" runat="server" Height="368px" Width="784px" BorderStyle="Solid">
				<P>   </P>
				<P>                                        
					<asp:Label id="Label1" runat="server" Height="16px" Width="317px" Font-Bold="True" Font-Size="Medium">Please enter a search criteria:</asp:Label>    
				</P>
				<P> 
					<asp:Label id="lblFindSiteCode" runat="server" Font-Bold="True" Font-Size="Small">Site Code:</asp:Label>         
					<asp:TextBox id="txtSiteCode" runat="server" Width="162px"></asp:TextBox>    
					<asp:Label id="lblCCC" runat="server" Height="18px" Width="100px" Font-Bold="True">CCC:</asp:Label>
					<asp:TextBox id="txtCCC" runat="server" Width="162px"></asp:TextBox></P>
				<P> 
					<asp:Label id="lblFindSiteName" runat="server" Width="101px" Font-Bold="True"> Site Name:</asp:Label>   
					    
					<asp:TextBox id="txtFindSiteName" runat="server" Width="453px"></asp:TextBox></P>
				<P> 
					<asp:Label id="lblFindIncid" runat="server" Height="26px" Width="100px" Font-Bold="True">Incident #:</asp:Label>       
					<asp:TextBox id="txtIncid" runat="server" Width="162px"></asp:TextBox></P>
				<P> 
					<asp:Label id="lblassignto" runat="server" Height="18px" Width="120px" Font-Bold="True">Assigned To:</asp:Label>   
					<asp:dropdownlist id="ddlAssignedTo" runat="server">
						<asp:ListItem Value="<Select Assigned To>"><Select Assigned To></asp:ListItem>
					</asp:dropdownlist> 
				</P>
				<P> 
					<asp:Label id="Label3" runat="server" Height="18px" Width="120px" Font-Bold="True">Escalated To:</asp:Label>   
					<asp:dropdownlist id="ddlEscalatedTo" runat="server">
						<asp:ListItem Value="<Select Escalated To>"><Select Escalated To></asp:ListItem>
					</asp:dropdownlist> 
				</P>
				<P>                                 
					<asp:Label id="lblIncidentNotFound" runat="server" Width="412px" Font-Bold="True" Font-Size="Medium" ForeColor="Red"></asp:Label>                                                               
				</P>
				<P>                                                                                            
					        
					<asp:Button id="btnFindIncident" runat="server" Text="Find Incident" Width="120px" Font-Bold="True"></asp:Button>     
				</P>
				<P> </P>
			</asp:panel>
</form>
	</body>
</HTML>
 
You really should consider using tables or even CSS or both.
Tables would increase your design time speed and make the layout more accurate.
 
For me to avoid this problem, I always remove the "MS_POSITIONING=GridLayout" in Body tab, and use HTML table to control my interface.

Use CSS like: style="Z-INDEX: 101; LEFT: 411px; POSITION: absolute; TOP: 130px", we always need to test and cater from different machines, so I won't allow those programmers under me to do that (only my opinion)
 
ok, good, I started using CSS and it's looks much better...

I've been creating CSS classes using ONE CSS file...

These are my questions:

1. For example, in my login page, the <TR> tag has a different width than for example, from second page.
Do i need a CSS file for each page that doesnt have the measurements in common with other pages?? How can i move the "style" tag to CSS..what is the equal of that in CSS??

2. How can I add "style" to CSS? For example, in the code below..That table tag doesnt accept "cssClass" element.


Code:
<TABLE id="Table1" [b]height="300" cellSpacing="0" cellPadding="1" width="800" align="center" border="0"[/b]>
				<TR>
					<TD style="WIDTH: 223px; HEIGHT: 46px" bgColor="lightsteelblue"><asp:label id="lblLogin" runat="server" Font-Size="Medium" BackColor="LightSteelBlue" Width="194px">LOGIN</asp:label></TD>
					<TD bgColor="lightsteelblue" style="HEIGHT: 46px"></TD>
				</TR>
				<TR>
					<TD [b]style="WIDTH: 223px"[/b]><asp:label id="lblUerId" runat="server" cssClass="LoginBoxes">UserID:</asp:label></TD>
					<TD><asp:textbox id="txtUserID" runat="server"></asp:textbox>
						<asp:RequiredFieldValidator id="rfvUserID" runat="server" ErrorMessage="   Please enter your UserId" ControlToValidate="txtUserID" Display="Dynamic"></asp:RequiredFieldValidator></TD>
				</TR>
 
To include CSS in HTML, use "Class" element, "cssClass" element just use by ASP.NET server control, but finally it will convert to "Class" too. So you can use "Class" element in your Table tag
 
Back
Top