G
Guest
Hello all,
I've created the following ASP.NET code sample which, when rendered,
displays a 100% textbox within a single cell table. The problem is that
Internet Explorer (6 or 7) truncates the right-hand edge of the textbox. The
textbox renders correctly on Firefox and Netscape.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb"
Inherits="Content_test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="frmMyForm" runat="server">
<table style="width: 100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<asp:TextBox ID="txtMyText" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
</table>
</form>
</body>
</html>
However, if the following DOCTYPE tag is used instead of the XHTML one
above...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
.... then IE renders the textbox correctly also.
Can anyone tell me why this happens? Why is the textbox rendered
differently between the two standards and why does only IE have the problem?
XHTML 1.0 appears to be the default DOCTYPE tag added to all .aspx pages (in
VS 2005/.NET 2.0), so I assume this is the latest standard we should be using.
Is there anything that can be done to make XHTML 1.0 work with IE so that
the textbox will display how I expect it to?
Any help appreciated.
Thanks,
Wayne.
I've created the following ASP.NET code sample which, when rendered,
displays a 100% textbox within a single cell table. The problem is that
Internet Explorer (6 or 7) truncates the right-hand edge of the textbox. The
textbox renders correctly on Firefox and Netscape.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb"
Inherits="Content_test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="frmMyForm" runat="server">
<table style="width: 100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<asp:TextBox ID="txtMyText" runat="server"
Width="100%"></asp:TextBox>
</td>
</tr>
</table>
</form>
</body>
</html>
However, if the following DOCTYPE tag is used instead of the XHTML one
above...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
.... then IE renders the textbox correctly also.
Can anyone tell me why this happens? Why is the textbox rendered
differently between the two standards and why does only IE have the problem?
XHTML 1.0 appears to be the default DOCTYPE tag added to all .aspx pages (in
VS 2005/.NET 2.0), so I assume this is the latest standard we should be using.
Is there anything that can be done to make XHTML 1.0 work with IE so that
the textbox will display how I expect it to?
Any help appreciated.
Thanks,
Wayne.