Solved

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

Posted on 2010-11-24
3
889 Views
Last Modified: 2012-06-27
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
Comment
Question by:zimmer9
3 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34209951
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
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 34209974
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
 
LVL 3

Expert Comment

by:rajuare
ID: 34211138
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question