473,506 Members | 17,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controls not displayed properly

11 New Member
Hi all,
I am developing a web application,and i have to access it from different machines.but my problem is that,the web controls that i am using shift when the page is displayed on different monitor.how can i avoid this.plz help.

thanks in advance.
Feb 19 '08 #1
10 1177
DrBunchman
979 Recognized Expert Contributor
Hi there,

Are the two machines using different browsers (or different versions of the same browser)? That is the most likely cause of your web pages rendering differently.

Dr B
Feb 19 '08 #2
Abhinavnaresh
11 New Member
Hi,
yes the IE versions that i am using are different,but my pages have to be opened on various machines with different browsers and different width and resolution.My pages should be perfect enough to be run on all machines.plz help.

thanks in advance.



Hi there,

Are the two machines using different browsers (or different versions of the same browser)? That is the most likely cause of your web pages rendering differently.

Dr B
Feb 19 '08 #3
DrBunchman
979 Recognized Expert Contributor
Do you know what a Document Type Definition (DTD) is? This is the thing that is specified in the <!DOCTYPE.....> tag at the beginning of your pages. It tells the browser which set of rules you are going to be using and therefore how to display the elements (tags) that make up your pages.

You're probably using the default Document Type Definition (DTD) for ASP.NET which is the XHTML 1.0 Transitional. You may need to change your DTD to an earlier one to get a more consistent look across different browsers. This tutorial is a good place to start

http://aspnetresources.com/articles/doctype.aspx

I had some problems with IE 6 and IE 7 a while back and I found that changing the DTD tag from

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/HTML]

To

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[/HTML]

achieved the results I wanted. If not you'll need to do some more research into the different DTD's.

I hope this helps,

Dr B
Feb 19 '08 #4
Abhinavnaresh
11 New Member
Hi,
I tried changing the doctype but the problem is still there,i am not able to view the page properly in my same machine.let me give u some more description. I am using CSS and placing an image as background.On some part of that image I am placing a few controls,but the controls are not displayed properly.Plz Help

Thanks in Advance.


Do you know what a Document Type Definition (DTD) is? This is the thing that is specified in the <!DOCTYPE.....> tag at the beginning of your pages. It tells the browser which set of rules you are going to be using and therefore how to display the elements (tags) that make up your pages.

You're probably using the default Document Type Definition (DTD) for ASP.NET which is the XHTML 1.0 Transitional. You may need to change your DTD to an earlier one to get a more consistent look across different browsers. This tutorial is a good place to start

http://aspnetresources.com/articles/doctype.aspx

I had some problems with IE 6 and IE 7 a while back and I found that changing the DTD tag from

[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/HTML]

To

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[/HTML]

achieved the results I wanted. If not you'll need to do some more research into the different DTD's.

I hope this helps,

Dr B
Feb 20 '08 #5
DrBunchman
979 Recognized Expert Contributor
Can you print your code please and also tell me which versions of IE you are trying to run it on?

Dr B
Feb 20 '08 #6
Abhinavnaresh
11 New Member
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6.          <style type="text/css">
  7. body
  8. background-image: url('demologinpagebg.jpg');
  9. background-repeat: no-repeat;
  10. background-position:center;
  11.  
  12. }
  13. </style>
  14.     <title>Asset Management-Login</title>
  15.  
  16. </head>
  17.  <body>
  18.     <form id="form1" runat="server">
  19.     <div>
  20.  
  21.  
  22.         <h1> <font size = "5"></font></h1>
  23.         <h1>
  24.             <font size="5" color = "navy">Asset Management </font>
  25.         </h1>
  26.  
  27.  
  28.         <asp:Label ID="Label1" runat="server" Style="z-index: 100; left: 666px; position: absolute;
  29.             top: 212px" Text="User Name" Width="99px" Height="23px"></asp:Label>
  30.         <asp:Label ID="Label2" runat="server" Style="z-index: 101; left: 667px; position: absolute;
  31.             top: 251px" Text="Password" Width="99px" Height="21px"></asp:Label>
  32.         <asp:TextBox ID="TextBox1" runat="server" Height="20px" Style="z-index: 102; left: 781px;
  33.             position: absolute; top: 212px" Width="126px"></asp:TextBox>
  34.         <asp:TextBox ID="TextBox2" runat="server" Height="20px" Style="z-index: 103; left: 780px; position: absolute; top: 248px" TextMode="Password" Width="126px"></asp:TextBox>
  35.         <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="z-index: 104;
  36.             left: 838px; position: absolute; top: 294px" Text="Login" Width="75px" />
  37.         <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Underline="True" ForeColor="Red"
  38.             Style="z-index: 105; left: 651px; position: absolute; top: 378px"></asp:Label>
  39.         <asp:Image ID="Image1" runat="server" Height="155px" ImageUrl="~/zenimage.jpg" Style="z-index: 107;
  40.             left: 11px; position: absolute; top: 462px" Width="225px" />
  41.  
  42.     </div>
  43.     </form>
  44. </body>
  45. </html>
Hi,
this is the html code i am working with.I am trying to display my web pages with IE 6,IE 7,and Firefox.I am placing my labels and textboxes on a part of the image.But when the page is displayed in the browser the controls get shifted.plz help ASAP.
Feb 20 '08 #7
kenobewan
4,871 Recognized Expert Specialist
Hi,
yes the IE versions that i am using are different,but my pages have to be opened on various machines with different browsers and different width and resolution.My pages should be perfect enough to be run on all machines.plz help.

thanks in advance.
This is where I believe the problem lies, your controls are fixed width and height. Perversely, you may need to try relative positioning - eg 50% width and height will always appear in the center regardless of any resolution. Credit to Mr Occam and his razor for the assistance.
Feb 20 '08 #8
Abhinavnaresh
11 New Member
Hi,
i tried changing the position to relative but the problem is still there.The controls are still shifting their place.dont know how to solve this issue.Plz help.

Thanks in advance.
Feb 20 '08 #9
DrBunchman
979 Recognized Expert Contributor
This is where I believe the problem lies, your controls are fixed width and height. Perversely, you may need to try relative positioning - eg 50% width and height will always appear in the center regardless of any resolution. Credit to Mr Occam and his razor for the assistance.
Hmmm....point taken!
Feb 20 '08 #10
Abhinavnaresh
11 New Member
any solution to my problem????i am still stuck.plz help









Hmmm....point taken!
Feb 28 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2315
by: Krzysztof Fink-Finowicki via .NET 247 | last post by:
I have problem with TEXTAREA HTML tags in my Web application (MSIE 6.0). User fills-in content of TEXTAREA on HTML dialog window. After accepting, content of TEXTAREA from dialog window is...
0
1322
by: Sreejith S S Nair | last post by:
hi, Setp one. i have one panel control in my form. I am spliting this panel control into two part say working region and holding region. This spliting is only logic spliting. That is i...
0
1175
by: Frnak McKenney | last post by:
I just spent four hours trying to find out why the checkboxes representing a bound DataGrid DataGridBoolColumn weren't acting properly. When the Form containing the DataGrid was initialized the...
1
2449
by: | last post by:
Hi Guys, I am generating dynamic server controls using XML and XSLT. With this I am generating two buttons which when clicked redirect the page to a different page. Here is my "checkout"...
5
2543
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...
0
873
by: Mark | last post by:
I'd like to build several reusable user controls. Each user control will have a different set of text boxes for a form. Only one user control will be on a page at a time. Based on the user's...
4
1313
by: JV | last post by:
It's easy to databind a listbox or dropdownlist if all you want is to fill it with a list of values. There are plenty of examples in the online help. Unfortunately, real world applications...
20
2394
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
22
2149
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
0
7220
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
7105
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
7308
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
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5617
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
5037
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
3188
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...
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
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.