473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

response.write a table

2
I have a problem when trying to display a table as part of an if else statement. The error that I get is the following:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/helpdesk/trackedissue.asp, line 154
else response.Write <table width="599" border="0" align="center">


The code is:

<%
if isnull(checkstatus.Fields.Item("solution").Value) then response.write "Sorry, this issue has not been resolved yet. Please try tracking later."
else response.write <table width="599" border="0" align="center">
<tr>
<td align="left" width="128">Solution:</td>
<td width="161" align="left">(trackingissue.Fields.Item("solution" ).Value)</td>
<td width="79"></td>
<td width="199"></td>
</tr>
</table>
end if
%>

I am a starter in asp programming, I would appreciate your help. I am using Dreamweaver cs3.

Thx in adv.
Mar 31 '08 #1
4 2301
shweta123
692 Expert 512MB
Hi,

Try to write the response.write statement like this :
e.g.

Expand|Select|Wrap|Line Numbers
  1.  response.write("<table width="599" border="0" align="center">")
I have a problem when trying to display a table as part of an if else statement. The error that I get is the following:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/helpdesk/trackedissue.asp, line 154
else response.Write <table width="599" border="0" align="center">


The code is:

<%
if isnull(checkstatus.Fields.Item("solution").Value) then response.write "Sorry, this issue has not been resolved yet. Please try tracking later."
else response.write <table width="599" border="0" align="center">
<tr>
<td align="left" width="128">Solution:</td>
<td width="161" align="left">(trackingissue.Fields.Item("solution" ).Value)</td>
<td width="79"></td>
<td width="199"></td>
</tr>
</table>
end if
%>

I am a starter in asp programming, I would appreciate your help. I am using Dreamweaver cs3.

Thx in adv.
Mar 31 '08 #2
DrBunchman
979 Expert 512MB
Hi,

Try to write the response.write statement like this :
e.g.

Expand|Select|Wrap|Line Numbers
  1.  response.write("<table width="599" border="0" align="center">")
This code will give you an error because the double quotes around the style settings will terminate the string. Use single quotes inside a response.write statement to surround styles & properties. e.g:
Expand|Select|Wrap|Line Numbers
  1. response.write "<table width='599' border='0' align='center'>"
Hope this helps,

Dr B
Mar 31 '08 #3
mispel
2
After posting, I tried again. And it worked like this:

Response.Write "<table width=" & "599" & "align=" & "center" & " border=" & "0" & "></table>"
And the whole code to create the table must be on the same line.
I had to create a large table so, it was hell of a job.

Thx for your help anyway.

Mayberly.
Mar 31 '08 #4
DrBunchman
979 Expert 512MB
Mispel,

Good job on geting it working although some of what you've done above is unneccessary. Are you aware of the rules on including quotation marks inside a string? To do so you use double quotation marks so you could write your line above like this:
Expand|Select|Wrap|Line Numbers
  1. Response.Write "<table width=""599"" align=""center"" border=""0""></table>"
Or you could, as I did before, write it using single quotation marks:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Response.Write "<table width='599' align='center' border='0'></table>"
  3.  
Which I think makes it look neater when reading through the code.

I'm afraid to say that you also had no need to write the whole table on the same line! This:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Response.Write "<table width='599' align='center' border='0'>"
  3. Response.Write "<tr>" 
  4. Response.Write "<td>Hello World!</td>"
  5. Response.Write "</tr>"
  6. Response.Write "</table>"
  7.  
Is exactly the same as:
Expand|Select|Wrap|Line Numbers
  1. Response.Write "<table width='599' align='center' border='0'><tr><td>Hello World!</td></tr></table>"
As you can see the first example is far easier to read than the second.

I hope this helps. Let us know if you have any more problems.

Dr B
Apr 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Hugh Welford | last post by:
Hi - trying to display a memo field using response.write but it truncates it. Is there a size issue with response.write? If so how do I get round it and to be able to display the whole memo field ...
1
by: Dan | last post by:
Hi I've created a generic 'Report' class that takes a DataView from a DataGrid control and writes it out to the response as a csv file for download. Basically, when a user clicks the download...
4
by: etropic | last post by:
Im confused I want an .aspx page to have a table with my data in it. At first I wrote FillTablew(); in my Page_Load even in the Code Behind file. I had it loop the db etc. and use Response.Write...
1
by: csgraham74 | last post by:
Hi there, ive written a function to display some returned values in a table. I use response.write to write the values as html. My problem is that this has stopped working correctly and i find...
2
by: Jack | last post by:
Hi, I have a asp page. This page pulls all data from a query. Part of the code is as follows: <% Response.Write "<table border='1' width='80%' height='1' cellspacing='1' >" Response.Write...
1
by: insist | last post by:
I with response.write("table=...") to draw the first table,and respons.write("<br>"),and then with response.write("table...") to draw the two table,but the two table display in the middle of the...
0
by: musosmiffy | last post by:
Hi, I have been trying to get the following working for days - I wonder if anyone could help me? I am trying to list a set of database entries as a newspaper column. I am using classic ASP (not...
7
by: Jim in Arizona | last post by:
I'm brand new at ajax. In fact, about 20 minutes ago was the first time I got it to work. The problem I'm having on another page did not work, however. I'm running into the following error: ...
5
by: satyabhaskar | last post by:
hi all, In my web page i have created radio buttons dynamically on to the page .....following is my code string Course, Semester, Section; int rowsCount; string con =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.