Solved

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

Posted on 2010-11-24
3
882 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 82

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now