how t write html code in asp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    how t write html code in asp

    sir i want to use the html tags in the asp page ...i want to ask that if it is same to ..just the way we wirte the break tag in asp.
    FOR EG.

    response.write( "<br>")

    but it is not working in the case if i try to make a table in asp the code that i have written is here

    Response.Write( "<table cellspacing="2" cellpadding="2" width="350" align="Center" valign="top" border="4">")
    please if any one could help me do reply :(:(:(
    and yes the error that i am recieving is here

    Error Type:
    Microsoft VBScript compilation (0x800A03EE)
    Expected ')'
    /sar/UPUForm.asp, line 65, column 36
    Response.Write( "<table cellspacing="2" cellpadding="2" width="350" align="Center" valign="top" border="4">")
    -----------------------------------^
  • shweta123
    Recognized Expert Contributor
    • Nov 2006
    • 692

    #2
    Hi,

    You can give it like this

    <%
    Response.write( "<html><body><t able border=1 width='100%'><t r><td>Name</td></tr></table></body></html>")
    %>

    Comment

    • omerbutt
      Contributor
      • Nov 2006
      • 638

      #3
      Miss
      its actually like i am trying to edit a specific record the procedure is that i display those fields from a database on an asp page after clicking on edit it posts the record no of that item on another page through which it displays the record against that record no in a form where we can modify it and then save it
      now where i want to display it in a form i just want that part to be written in asp
      the rest of the page is in html so you know i cant do that what you have told..... in that case i have to write the whole page in asp tags ...where i have already written the html on the top of the page...other than that if u say i can paste the code here if ya like ....kkk ..and fankssss for the help :) ..fankss aloot :)
      Originally posted by shweta123
      Hi,

      You can give it like this

      <%
      Response.write( "<html><body><t able border=1 width='100%'><t r><td>Name</td></tr></table></body></html>")
      %>

      Comment

      • aasna
        New Member
        • Apr 2007
        • 4

        #4
        hi

        you can use the normal html tags in an asp page also. the problem i understood is that u want to display the database details in a tabular format.

        try using this

        <html>
        <body>

        <%

        ' Database connection part

        %>

        <div align="center">

        <table BORDER="1" width="681" bordercolordark ="#4682B4" bordercolorligh t="#00FFFF" bgcolor="#FFFDE 8" height="67" style="border-color: #00FFFF"><colou r="FFF5EE">

        <tr>

        <td width="86" align="center" style="border-color: #4682B4"><b><h3 >
        <font face="Estrangel o Edessa" color="#000000" >RecordNo</font></td>

        </tr>

        <%

        Do While not rsDisplayuser.E OF

        %>

        <tr>
        <td >

        <%= rsDisplayuser(" RecordNo") %>

        </td>
        </table>
        </body>
        </html>

        regards
        aasna

        Comment

        • jhardman
          Recognized Expert Specialist
          • Jan 2007
          • 3405

          #5
          Originally posted by omerbutt
          sir i want to use the html tags in the asp page ...i want to ask that if it is same to ..just the way we wirte the break tag in asp.
          FOR EG.

          response.write( "<br>")

          but it is not working in the case if i try to make a table in asp the code that i have written is here

          Response.Write( "<table cellspacing="2" cellpadding="2" width="350" align="Center" valign="top" border="4">")
          please if any one could help me do reply :(:(:(
          and yes the error that i am recieving is here

          Error Type:
          Microsoft VBScript compilation (0x800A03EE)
          Expected ')'
          /sar/UPUForm.asp, line 65, column 36
          Response.Write( "<table cellspacing="2" cellpadding="2" width="350" align="Center" valign="top" border="4">")
          -----------------------------------^
          The only problem is the double quotes in the response.write string. For HTML transtional you can leave out the double quotes in most tag attributes
          Code:
          Response.Write("<table cellspacing=2 cellpadding=2 width=350 align=Center valign=top border=4>")
          or use single quotes
          Code:
          Response.Write("<table cellspacing='2' cellpadding='2' width='350' align='Center' valign='top' border='4'>")
          Otherwise the server will interpret it as
          Code:
          Response.Write("<table cellspacing="
          followed by a bunch of garbage. or you could replace all of the double quotes with chr(34) but that gets very tedious. Probably the best solution is aasna's post above, but I wanted to let you know you don't need to change your code that much.

          Let me know if this helps.

          Jared

          Comment

          • sank06
            New Member
            • Dec 2006
            • 7

            #6
            how do i write dataset,html tags in asp

            response.write( "<tr><td width='70%'>" <%= rs("question")% > "</td>")

            Comment

            • omerbutt
              Contributor
              • Nov 2006
              • 638

              #7
              Originally posted by sank06
              how do i write dataset,html tags in asp

              response.write( "<tr><td width='70%'>" <%= rs("question")% > "</td>")
              try it like this
              response.write( "<tr>")
              response.write( "<td width='70%'>" )
              response.write( rs.fields("ques tion"))
              response.write( "</td>")
              response.write( "</tr>")
              [/QUOTE]

              Comment

              • jhardman
                Recognized Expert Specialist
                • Jan 2007
                • 3405

                #8
                Originally posted by sank06
                how do i write dataset,html tags in asp

                response.write( "<tr><td width='70%'>" <%= rs("question")% > "</td>")
                Whenever you get large stretches of HTML, I would consider stopping the vbscript:
                [code=asp]%>
                <tr><td width="70%"><%= rs("question")% ></td>
                <%[/code]However, if I wanted to write it more like you tried, it would look like this:[code=asp]response.write "<tr><td width='70%'>" & rs("question") & "</td>"[/code]Let me know if this helps.

                Jared

                Comment

                Working...