Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 907
  • Last Modified:

Do you know how to convert 3 classic ASP lines that have errors because they are outdated?

I am trying to debug a classic ASP application using VS2005.

I placed the following ASP file into VS2005.

Do you know how I can resolve the following errors and warnings on 3 lines in the code section that follows?

Line 8 generates the following messages:

Validation (XHTML 1.0 Transitional): Attribute 'leftmargin' is not a valid attribute of element 'body'.                       c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Attribute 'topmargin' is not a valid attribute of element 'body'.                       c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Attribute 'marginwidth' is not a valid attribute of element 'body'.                       c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Attribute 'marginheight' is not a valid attribute of element 'body'.                       c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Text is not allowed between the opening and closing tags for element body'.      c:\inetpub\wwwroot\MyWeb\default.asp                  http://localhost/MyWeb/

------

Line 12  generates the following messages:

Validation (XHTML 1.0 Transitional): Attribute 'width' is considered outdated. A newer construct is recommended.      c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/


Validation (XHTML 1.0 Transitional): Attribute values must be enclosed in quotation marks.                                         c:\inetpub\wwwroot\MyWeb\default.asp      
http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Element 'img' is missing required attribute 'alt'.                                                           c:\inetpub\wwwroot\MyWeb\default.asp      
http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Empty elements such as 'img' must end with />.                                                           c:\inetpub\wwwroot\MyWeb\default.asp      
http://localhost/MyWeb/

--------

Line 13  generates the following messages:

Validation (XHTML 1.0 Transitional): Attribute 'width' is considered outdated. A newer construct is recommended. c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Attribute values must be enclosed in quotation marks.                                   c:\inetpub\wwwroot\MyWeb\default.asp      
http://localhost/MyWeb/

Validation (XHTML 1.0 Transitional): Element 'font' is considered outdated. A newer construct is recommended. c:\inetpub\wwwroot\MyWeb\default.asp            http://localhost/MyWeb/




Line 8: 
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bgBlueDark">
	<tr> 

Line 12: 		<td width="30%" align=left> <img height="42" src="images/hdr_y_logo.gif" width="152"></td>

Line 13:		<td width="70%" align="center"><font color=white></font></td>

		<td>&nbsp;</td>
	</tr>
	<tr> 
		<td width="730" colspan="2"><img src="images/transpix.gif" width="1" height="1" vspace="1"></td>
		<td><img src="images/transpix.gif" width="1" height="1" vspace="1"></td>
	</tr>
	<tr> 
		<td class="bgBlueDark" width="730" colspan="2"> 
		</td>
		<td class="bgBlueDark"> 
		</td>
	</tr>
	</table>

Open in new window

0
zimmer9
Asked:
zimmer9
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Mostly they are expecting you to use CSS styles in the head section like below.  You can also define the width of an element in CSS in the class that is applied to the element.  Attribute values quoted and 'alt' attribute added to <img> tags.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!-- 
body { margin: 0;}
.whitetext { color: #ffffff;} 
-->
</style>
</head>
<!-- Line 8:  -->
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="bgBlueDark">
	<tr> 
		<td width="30%" align=left>
		<img height="42" src="images/hdr_y_logo.gif" width="152" alt="" /></td>
		<td width="70%" align="center" class="whitetext"><!-- <font color="white"></font> --></td>
		<td>&nbsp;</td>
	</tr>
	<tr> 
		<td width="730" colspan="2">
		<img src="images/transpix.gif" width="1" height="1" vspace="1" /></td>
		<td><img src="images/transpix.gif" width="1" height="1" vspace="1" alt="" /></td>
	</tr>
	<tr> 
		<td class="bgBlueDark" width="730" colspan="2"> 
		</td>
		<td class="bgBlueDark"> 
		</td>
	</tr>
</table>

</body>
</html>

Open in new window

0
 
sammySeltzerCommented:
replace leftmargin = "0" with
style="margin-left: 0; top-margin:0; margin-height:0;"

then for image:


<img height="42" src="images/hdr_y_logo.gif" width="152" alt="my image">
0
 
rajuareCommented:
1) Good solution is don't use the VS2005 ... you have lot of head ache for using VS2005 for ASP.
2) Best practice is use "Response.write" and print vaiable name line by line .... you could resolve all problem in AEAP

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now