We help IT Professionals succeed at work.

Making Table Thru ASP Response.write

Whing Dela Cruz
on
326 Views
Last Modified: 2017-04-11
Hi experts, I wish to put an id of the table below but when i tried to insert id="myTable" it didn't work. And also the result of the code as the client received this, (the server), it shows no table except the data. Any help please.

      If not .BOF = True And not .EOF = True Then 'found record
         response.write("<table>")
         do until rs.EOF
            response.write("<tr><td>" & Response.Write(rs("Procode")) & "</td>")
            response.write("<tr><td>" & Response.Write(rs("Proname")) & "</td></tr>")
            rs.MoveNext
         loop
         response.write("</table>")
      else
         response.write("No record!")
      End If

Open in new window

Comment
Watch Question

Author

Commented:
HI experts, The code below is working. The problem now is how to put id on table and put event on the button. Any help please!

      If not .BOF = True And not .EOF = True Then 'found record
      response.write("<table>")
            do until rs.EOF
                response.write("<tr>")
                response.write("<td>" & "<button>Add item</button>" & "</td>")
                response.write("<td>" & rs("Procode") & "</td>")
                response.write("<td>" & rs("Proname") & "</td>")
                response.write("<td>" & rs("UnitCost") & "</td>")
              rs.MoveNext
            loop
      response.write("</tr>")
      response.write("</table>")
      else
         response.write("No record!")
      End If

Open in new window

CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi Julian, its working. Thank you so much!
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
You are welcome.

Remember quotes in strings in ASP require a double quote to escape them. If this happens at the end of the string you will have 3 quotes together.

Author

Commented:
Noted sir, and thanks a lot!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.