Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-11-24
3
Medium Priority
?
903 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 84

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 29

Accepted Solution

by:
sammySeltzer earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

721 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