Announcement

Collapse
No announcement yet.

Need Help with ASP Respose.Write

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need Help with ASP Respose.Write

    I'm having problems trying to put a variable into a table row.
    <pre class="ip-ubbcode-code-pre">
    &lt;%
    tempStr = hs.DeviceStringByName("Computer room CNN Headlines")
    Response.Write "&lt;h4&gt;These are the latest headlines from CNN. You may click on the headlines to view the story&lt;/h4&gt;&lt;br&gt;"

    %&gt;
    &lt;%=tempStr%&gt; 'this is before the table and demonstrates the variable works
    &lt;%
    Response.Write "&lt;table class=tableheader border="2" width="90%" allign="center" cellspacing="4px"&gt;&lt;tr&gt;&lt;th&gt;CNN Headlines&lt;/th&gt;&lt;th&gt;Select&lt;/th&gt;&lt;th&gt;Instructions&lt;/th&gt;&lt;/tr&gt;

    Response.Write "&lt;tr&gt;&lt;class=tablecolumn&gt;"
    Response.Write ("&lt;td&gt;Column 1&lt;/Td&gt;&lt;td&gt;&lt;br")

    Response.BinaryWrite(tempStr) 'No matter what I use here I cannot get it to work I have tried using &lt;%=tempStr%&gt;, Response.Write but all I get is the statement itself in the cell.
    Response.Write ("&lt;/td&gt;&lt;td&gt;Column 3&lt;/Td&gt;")
    Response.Write "&lt;/tr&gt;&lt;/table&gt;"

    %&gt;
    &lt;%=CustomFooter%&gt;

    </pre> <span class="ev_code_PURPLE">
    I think there must be something special when writing into a cell. But also I'm getting some Response.Write errors on the page as well. So it may be from something else. If you can review the code above and help, I would very greatful.
    </span>

    #2
    From first glance at it, you are using double quotes in the string for example border="2" if you want to include it in the string itself you need border=""2"" or border ='2' use 2 quotes in a row to include it in the string, or just switch to 1 single quote since HTML understands that also.

    Dave

    Comment


      #3
      Dave,

      Thanks for the quick reply. I used apostrophys and discovered I had an unterminated line (no " at end of the line). Now it works quite nicely. I spent most of the day trying to debug this but with your reply I had it working in about four minutes.

      So many thanks for your help! This one of those forrest and trees.

      Comment


        #4
        A couple of things I see.

        <pre class="ip-ubbcode-code-pre">
        Response.Write "&lt;tr&gt;&lt;class=tablecolumn&gt;"
        Response.Write ("&lt;td&gt;Column 1&lt;/Td&gt;&lt;td&gt;&lt;br")
        </pre>
        There's a missing &gt; on the br from the above statement.
        <pre class="ip-ubbcode-code-pre">
        Response.BinaryWrite(tempStr)
        </pre>
        This needs to be Response.Write (tempStr)
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Rupp,

          I probably deleted it in my post because it's in my code &lt;br&gt;. But it's great having other eyes looking at it. Ther's lots of things I can do now that I've got it working. I can now tune it up to look better and improve performance. I added lots of code to try and debug the problem.

          Comment

          Working...
          X