Lots of Response.Writes of HTML - How do YOU do it?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TinyTim

    Lots of Response.Writes of HTML - How do YOU do it?

    I'm a newbie at ASP & HTML. It seems that when you use server side
    code and you're going to return a customized HTML form with several
    fields and labels, you have to do an extensive amount of
    Response.Writes .

    Are there any tools that will let you design the form then convert
    that form to Response.Writes that you can further customize with ASP
    logic? For instance: use Dreamweaver to design the form, then another
    program to convert to response.writes in an aspx file.

    What's the easy way of doing it? Just trying to make it less
    laborious for me.

    Response.Write "Thanks,"

    tt

  • Paul Baker [MVP, Windows - SDK]

    #2
    Re: Lots of Response.Writes of HTML - How do YOU do it?

    That's an interesting question. However, it is only the dynamic parts of the
    HTML that you need to worry about.

    The rest of it, you can put in the ASP as is simply by closing the brackets.

    eg.

    <%
    whatever = ...
    Response.Write( whatever)
    %>
    <form>
    blah blah blah
    </form>
    <%
    ...
    %>

    You can also use =expression as shorthand for writing an expression if it is
    the entire code within brackets.

    For example <%=whatever%> instead of <%Response.Writ e(whatever)%>

    Does that help?

    Paul

    "TinyTim" <TinyTim@MissVi cky.com> wrote in message
    news:ar3lh0p2eh 98lcgtn3opaar8b 0uv5j8bpi@4ax.c om...[color=blue]
    > I'm a newbie at ASP & HTML. It seems that when you use server side
    > code and you're going to return a customized HTML form with several
    > fields and labels, you have to do an extensive amount of
    > Response.Writes .
    >
    > Are there any tools that will let you design the form then convert
    > that form to Response.Writes that you can further customize with ASP
    > logic? For instance: use Dreamweaver to design the form, then another
    > program to convert to response.writes in an aspx file.
    >
    > What's the easy way of doing it? Just trying to make it less
    > laborious for me.
    >
    > Response.Write "Thanks,"
    >
    > tt
    >[/color]


    Comment

    • Dave Anderson

      #3
      Re: Lots of Response.Writes of HTML - How do YOU do it?

      TinyTim wrote:[color=blue]
      > I'm a newbie at ASP & HTML. It seems that when you use server side
      > code and you're going to return a customized HTML form with several
      > fields and labels, you have to do an extensive amount of
      > Response.Writes .[/color]

      Are you aware that this...
      <%=myVar%>

      ....is a lexical shorthand for this?
      <% Response.Write( myVar) %>


      Most of my documents are written so the HTML is a single continuous section,
      dotted with tokens. Form element examples:

      <input name="LastName" value="<%=Page. LastName%>">
      <select name="Role"><%= Page.RoleOption List%></select>
      <textarea name="Comments" ><%=Page.Commen ts%></textarea>

      The logic for populating the variables has been abstracted away to a
      server-side-only segment of the script, and the above displays just fine in
      a tool like Dreamweaver.


      --
      Dave Anderson

      Unsolicited commercial email will be read at a cost of $500 per message. Use
      of this email address implies consent to these terms. Please do not contact
      me directly or ask me to contact you directly for assistance. If your
      question is worth asking, it's worth posting.


      Comment

      • TinyTim

        #4
        Re: Lots of Response.Writes of HTML - How do YOU do it?

        I'm looking at Snitz forum code for my examples, one of which I
        included in this post. Even with your described methods, it seems
        like a lot of work, having to design the page layout manually then
        putting the appropriate quote marks, underscores, etc in code.
        [color=blue]
        >For example <%=whatever%> instead of <%Response.Writ e(whatever)%>[/color]
        I'll be checking this method out on one of the online tutorials. Can
        you point me to a specific tutorial?

        Thanks,

        tt

        '--------------- Code Snippet Follows --------------------------------
        else
        Response.Write " <p><font face=""" & strDefaultFontF ace
        & """ size=""" & strHeaderFontSi ze & """>You do not have permission to
        change another users subscription. Only Administrators may change
        another users subscriptions.</font></p>" & vbNewline

        ' ## This is just the form which is used to login if the
        person is
        ' ## not logged in or does not have access to do the
        moderation.
        Response.Write " <form
        action=""pop_su bscription.asp? UserCheck=Y"" method=""post""
        id=""Form1"" name=""Form1""> " & vbNewline & _
        " <input type=""hidden""
        name=""REPLY_ID "" value=""" & ReplyID & """>" & vbNewline & _
        " <input type=""hidden""
        name=""TOPIC_ID "" value=""" & TopicID & """>" & vbNewline & _
        " <input type=""hidden""
        name=""FORUM_ID "" value=""" & ForumID & """>" & vbNewline & _
        " <input type=""hidden"" name=""CAT_ID""
        value=""" & CatID & """>" & vbNewline & _
        " <table border=""0"" width=""75%""
        cellspacing=""0 "" cellpadding=""0 "">" & vbNewline & _
        " <tr>" & vbNewline & _
        " <td bgcolor=""" &
        strPopUpBorderC olor & """>" & vbNewline & _
        " <table border=""0""
        width=""100%"" cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
        if strAuthType = "db" then
        Response.Write " <tr>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """ align=""right"" nowrap><b><font face=""" &
        strDefaultFontF ace & """ size=""" & strDefaultFontS ize & """>User
        Name:</font></b></td>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """><input type=""text"" name=""name"" value="""
        & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
        " </tr>" & vbNewline & _
        " <tr>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """ align=""right"" nowrap><b><font face=""" &
        strDefaultFontF ace & """ size=""" & strDefaultFontS ize &
        """>Passwor d:</font></b></td>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """><input type=""password "" name=""password ""
        value="""" size=""20""></td>" & vbNewline & _
        " </tr>" & vbNewline
        else
        Response.Write " <tr>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """ align=""right"" nowrap><b><font face=""" &
        strDefaultFontF ace & """ size=""" & strDefaultFontS ize & """>NT
        Account:</font></b></td>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """><input type=""text"" name=""DBNTUser Name""
        value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
        " </tr>" & vbNewline
        end if
        Response.Write " <tr>" & vbNewline & _
        " <td bgColor=""" &
        strPopUpTableCo lor & """ colspan=""2"" align=""center" "><Input
        type=""Submit"" value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
        & vbNewline & _
        " </tr>" & vbNewline & _
        " </table>" & vbNewline & _
        " </td>" & vbNewline & _
        " </tr>" & vbNewline & _
        " </table>" & vbNewline & _
        " </form>" & vbNewline
        end if
        '--------------- End of Code Snippet --------------------------------

        On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
        <paulb@online.r ochester.rr.com > wrote:
        [color=blue]
        >That's an interesting question. However, it is only the dynamic parts of the
        >HTML that you need to worry about.
        >
        >The rest of it, you can put in the ASP as is simply by closing the brackets.
        >
        >eg.
        >
        ><%
        > whatever = ...
        > Response.Write( whatever)
        >%>
        ><form>
        > blah blah blah
        ></form>
        ><%
        > ...
        >%>
        >
        >You can also use =expression as shorthand for writing an expression if it is
        >the entire code within brackets.
        >
        >For example <%=whatever%> instead of <%Response.Writ e(whatever)%>
        >
        >Does that help?
        >
        >Paul
        >
        >"TinyTim" <TinyTim@MissVi cky.com> wrote in message
        >news:ar3lh0p2e h98lcgtn3opaar8 b0uv5j8bpi@4ax. com...[color=green]
        >> I'm a newbie at ASP & HTML. It seems that when you use server side
        >> code and you're going to return a customized HTML form with several
        >> fields and labels, you have to do an extensive amount of
        >> Response.Writes .
        >>
        >> Are there any tools that will let you design the form then convert
        >> that form to Response.Writes that you can further customize with ASP
        >> logic? For instance: use Dreamweaver to design the form, then another
        >> program to convert to response.writes in an aspx file.
        >>
        >> What's the easy way of doing it? Just trying to make it less
        >> laborious for me.
        >>
        >> Response.Write "Thanks,"
        >>
        >> tt
        >>[/color]
        >[/color]

        Comment

        • TinyTim

          #5
          Re: Lots of Response.Writes of HTML - How do YOU do it?

          Can you a more complete example or tutorial? I seem to be a bit
          thick-headed on this subject. Also please see my response to the
          previous message in this thread.

          tt

          On Wed, 11 Aug 2004 16:56:19 -0500, "Dave Anderson"
          <GTSPXOESSGOQ@s pammotel.com> wrote:
          [color=blue]
          >TinyTim wrote:[color=green]
          >> I'm a newbie at ASP & HTML. It seems that when you use server side
          >> code and you're going to return a customized HTML form with several
          >> fields and labels, you have to do an extensive amount of
          >> Response.Writes .[/color]
          >
          >Are you aware that this...
          > <%=myVar%>
          >
          >...is a lexical shorthand for this?
          > <% Response.Write( myVar) %>
          >
          >
          >Most of my documents are written so the HTML is a single continuous section,
          >dotted with tokens. Form element examples:
          >
          > <input name="LastName" value="<%=Page. LastName%>">
          > <select name="Role"><%= Page.RoleOption List%></select>
          > <textarea name="Comments" ><%=Page.Commen ts%></textarea>
          >
          >The logic for populating the variables has been abstracted away to a
          >server-side-only segment of the script, and the above displays just fine in
          >a tool like Dreamweaver.[/color]

          Comment

          • Harag

            #6
            Re: Lots of Response.Writes of HTML - How do YOU do it?

            On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <TinyTim@MissVi cky.com>
            wrote:
            [color=blue]
            >I'm looking at Snitz forum code for my examples, one of which I
            >included in this post. Even with your described methods, it seems
            >like a lot of work, having to design the page layout manually then
            >putting the appropriate quote marks, underscores, etc in code.
            >[color=green]
            >>For example <%=whatever%> instead of <%Response.Writ e(whatever)%>[/color]
            >I'll be checking this method out on one of the online tutorials. Can
            >you point me to a specific tutorial?
            >
            >Thanks,
            >
            >tt[/color]

            Welcome to the world of web development where typing is essential :)

            I have a Include file that I include into EVERY .asp page, this file
            has several functions that I use things like:

            out(); // I use this instead of Response.Write
            debugOut() // this is to display variable data etc. and if I
            forget to take it out its not shown on the live server.
            onLocalServer() ; // this returns true if the site is running on my
            test server

            I'll include the file below incase its of any interest to you. Note
            that its all in JScript. Sorry for all the tabs, I can't be bothered
            to change them to spaces. copy & paste into notepad.

            HTH

            Al


            <%
            //*************** *************** *************** *************** *************** ****
            //* F U N C T I O N S / S U B S
            //*************** *************** *************** *************** *************** ****
            var g_bDebug; // t/f whether in debugging mode or not.

            //*************** *************** *************** *************** *************** ****
            /* This function to saftly convert a VBscript array into a JS 1
            Dimension array
            a VBscript array will normally be returned when using the ADO
            "Recordset.GetR ows()" method - like in the clsDBErrorCheck er.asp File
            it adds 2 custom properties to the Jscript Array called
            "numberOfRo ws" &
            "numberOfColumn s" if no array is return from the RS.GetRows() method
            (eg a DBerror)
            then it will return a "string" which this JS function detects and
            returns an
            array with nothing in it so check if arrayname.lengt h >0 before use.
            */

            function VB_JSarray(aVBA rrayFromDBCheck _OpenIntoArrayM ethod,
            displayDebugInf o) {
            if (typeof aVBArrayFromDBC heck_OpenIntoAr rayMethod !=
            'string') {
            vbRowsArray = new
            VBArray(aVBArra yFromDBCheck_Op enIntoArrayMeth od);
            var numberOfColumns = vbRowsArray.ubo und(1) + 1;
            var numberOfRows = vbRowsArray.ubo und(2) + 1;
            var rowsArray = vbRowsArray.toA rray();
            rowsArray.rows = numberOfRows;
            rowsArray.cols = numberOfColumns ;
            if (displayDebugIn fo) {
            debugOut('{HEAD }VB_JSarray()', 'Rows=' +
            rowsArray.rows, 'Columns=' + rowsArray.cols, 'rowsArray=' +
            rowsArray);
            }
            } else {
            var rowsArray = Array();
            rowsArray.rows = 0;
            rowsArray.cols = 0;
            }
            return rowsArray;
            }


            //*************** *************** *************** *************** *************** ****
            // Are we in debug mode?
            function inDebugMode() {
            if (typeof g_bDebug == 'undefined') {
            g_bDebug = false;
            if (onLocalServer( ) ||
            Request.QuerySt ring('debug').C ount > 0) {
            g_bDebug = true;
            }
            }
            return g_bDebug;
            }

            // This debug accepts any amount of arguments with no [] around the
            text
            // and creates a long html string accordingly to display the info.
            function debugOut() {
            if (inDebugMode()) {
            var sDebugWord = 'GUBED';
            var sOutput = sDebugWord, sText='';

            if (arguments.leng th < 1) {
            sOutput += '<span style="backgrou nd:#555;
            color:#CCC; font: bold italic 12px Comic Sans MS, Verdana;">{NO
            ARGUMENTS FOR THE DEBUG FUNCTION}&nbsp; </span>';
            } else {
            for (var i = 0; i < arguments.lengt h; i++) {
            sText = String(argument s[i]).trim();
            // If blank text or <br> text then
            display a blank line
            if (sText && sText != '' && sText !=
            '<br>' && sText != '\r\n') {
            // Do the debug title.
            if
            (sText.toUpperC ase().substring (0, 6) == '{HEAD}') {
            sText =
            sText.toUpperCa se();
            }
            // highlight the "=" sign.
            This is done first as the "=" sign appears in all the
            // properties of HTML (eg
            style="")
            sText = sText.replace(/=/g,
            '<span style="font-weight:bold; color:#F90;">=</span>');
            // If its a Header debugOut
            then change color.
            if (sText.substrin g(0, 6) ==
            '{HEAD}') {
            sText = '<span
            style="font-weight:bold; color:#CCC;">' + sText.substring (6) +
            '</span>';
            }
            // If its a highlight debugOut
            then change the color from the default.
            sText =
            sText.replace(/{HIGH}/gi, '<span style="color:#F 90; font: bold 12px
            Verdana;">');
            sText =
            sText.replace(/{\/HIGH}/gi, '</span>');

            // if the text isn't
            surrounded with {...} then add the brackets to the
            // front and the back of the
            string
            if (sText.charAt(0 ) != '{') {
            sText = '{' + sText;
            }
            if
            (sText.charAt(s Text.length-1) != '}') {
            sText += '}';
            }

            // if there is no info after
            the "=" then insert word "EMPTY"
            sText =
            sText.replace(' =</span>}', '=</span><span style="font: bold 12px
            Verdana;; color:#C00;">EM PTY</span>}');

            var sText = '<span
            style="backgrou nd:#555; color:#0BB; font:12px Verdana;">' + sText +
            '&nbsp;</span>' ;
            // If there is more than 5
            elements then wrap the output every 5 elements.
            if (i % 5 == 4 && i !=
            arguments.lengt h-1) {
            sText += sDebugWord;
            }
            // Add the created string to
            the total output string
            sOutput += sText;
            } else {
            sOutput += '<br>';
            }
            }

            }
            // Change all the [.] & {.} in the output string to a
            differnt color so they stand
            // out better from the rest
            sOutput = sOutput.replace (/(\[|\])/g,'<span
            style="font-weight:bold; color:#0CC;">$1 </span>');

            sOutput = sOutput.replace (/(\{|\})/g,'<span
            style="font-weight:bold; color:#FC0;">$1 </span>');
            // Change the word {DEBUG} so the debug title stands
            out better.
            sOutput = sOutput.replace (/GUBED/g,'<br><span
            style="backgrou nd:#600; color:#C00; font: bold 12px Comic Sans MS,
            Verdana;">&nbsp ;{&nbsp;DEBUG&n bsp;}&nbsp;</span>');
            // Output the final string.
            out(sOutput);
            }
            }

            //*************** *************** *************** *************** *************** ****
            // only display when in debug mode as defined in inDebugMode() above
            // this is to add a touch of color to any debug strings.
            function debugHighlight( sText) {
            if (inDebugMode()) {
            if (sText && sText != '') {
            sText = '{HIGH}' + sText.trim() + '{/HIGH}';
            }
            }
            return sText;
            }

            //*************** *************** *************** *************** *************** ****
            // Justs puts a comment to the HTML file for easy reading
            function debugOutHeader( sHeader, bMainHeader) {
            var sNewHead = '', sTxt;

            if (inDebugMode()) {
            sHeader = String(sHeader) .toUpperCase() || "No Header
            Text";
            if (sHeader.length > 0 ) {
            if (bMainHeader) {
            for (var i = 0; i < sHeader.length;
            i++) {
            sNewHead += sHeader.charAt( i)
            + ' ';
            if (sHeader.charAt (i) == ' ')
            {
            sNewHead += ' ';
            }
            }
            sNewHead=sNewHe ad.trim();
            sTxt = '\r\n<!--\r\n';
            sTxt +=
            '************** *************** *************** *************** *\r\n';
            sTxt += '************** * ' + sNewHead
            + ' *************** \r\n';
            sTxt +=
            '************** *************** *************** *************** *\r\n';
            sTxt += '-->\r\n';
            } else {
            sNewHead = sHeader;
            sTxt = '\r\n<!-- [DebugHeader]
            ********** ' + sNewHead + ' ********** -->\r\n';
            }
            out(sTxt);
            }
            }
            }

            //*************** *************** *************** *************** *************** ****
            // simple wrapper for Response.Write,
            function out(sText) {
            Response.Write (sText);
            if (inDebugMode()) {
            Response.Write ('\r\n');
            }
            }

            //*************** *************** *************** *************** *************** ****
            // OutJS is mainly used for outputting JS files as these are easier
            with
            // returns & linefeeds.
            function outJS(sText) {
            Response.Write (sText + '\r\n');
            }

            //*************** *************** *************** *************** *************** ****
            // use Response.Redire ct or Server.Transfer depending on ASP version
            function redirect(sDesti nation) {
            // use expensive round-trip redirect always
            // Server.Transfer caused problems
            Response.Redire ct (sDestination);
            }


            //*************** *************** *************** *************** *************** ****
            // to return the html code for a transparent image of iWidth, iHeight
            function pixelImage(iWid th, iHeight) {
            if (iWidth < 1 || !iWidth) {
            iWidth = 1;
            }
            if (iHeight < 1 || !iHeight) {
            iHeight = 1;
            }
            return '<img src="/Images/Pixel.gif" width="' + iWidth + '"
            height="' + iHeight + '" alt="" border="0">';
            }

            //*************** *************** *************** *************** *************** ****
            function closeWindow(bCe ntered) {
            var sText = '';
            if (bCentered) {
            sText = '<div style="text-align:center; margin:10px;
            2px;">';
            }
            sText += '<span class="Font01">[&nbsp;<a href="#"
            onclick="window .close(); return false;">Close
            Window</a>&nbsp;]</span>';
            if (bCentered) {
            sText += '</div>';
            }
            return sText;
            }

            //*************** *************** *************** *************** *************** ****
            function closeWindowAndO pener(bCentered ) {
            var sText = '';
            if (bCentered) {
            sText = '<div style="text-align:center; margin:10px;
            2px;">';
            }
            sText += '<span class="Font01">[&nbsp;<a href="#"
            onclick="window .close(); window.opener.c lose();return false;">Close
            Window</a>&nbsp;]</span>';
            if (bCentered) {
            sText += '</div>';
            }
            return sText;
            }

            //*************** *************** *************** *************** *************** ****
            function userErrorMessag e(sErrorText) {
            // Note you need the SFX.CSS file included for this to look
            right.
            return '<div class="bg900 Bordered Font02" style="padding: 0em
            1em; text-indent: -1em;"><span class="bg600 Font04" style="color:#C 00;
            font-weight: bold;">&nbsp;ER ROR:&nbsp;</span>&nbsp;' + sErrorText +
            '</div>';
            }

            //*************** *************** *************** *************** *************** ****
            // Convert a string to a Base10 number, if it cannot be converted then
            return
            // the devault value. This is used to make sure that input from web
            forms are
            // actually numbers and not string... eg Age, quantity. etc.
            function convertToNumber (sString, iDefault) {
            var iNewVal = parseFloat(sStr ing, 10) || iDefault || 0;
            sString = (''+sString).to LowerCase();

            if (sString == 'true' || sString == 'yes' || sString == 'on')
            {
            iNewVal = true;
            }
            if (sString == 'false' || sString == 'no' || sString == 'off')
            {
            iNewVal = false;
            }
            if (isNaN(iNewVal) ) {
            iNewVal = iDefault;
            }
            return iNewVal;
            }

            //*************** *************** *************** *************** *************** ****
            //*************** *************** *************** *************** *************** ****
            //*************** *************** *************** *************** *************** ****
            //*************** *************** *************** *************** *************** ****
            //*************** *************** *************** *************** *************** ****
            %>


            [color=blue]
            >
            >'--------------- Code Snippet Follows --------------------------------
            >else
            > Response.Write " <p><font face=""" & strDefaultFontF ace
            >& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
            >change another users subscription. Only Administrators may change
            >another users subscriptions.</font></p>" & vbNewline
            >
            > ' ## This is just the form which is used to login if the
            >person is
            > ' ## not logged in or does not have access to do the
            >moderation.
            > Response.Write " <form
            >action=""pop_s ubscription.asp ?UserCheck=Y"" method=""post""
            >id=""Form1"" name=""Form1""> " & vbNewline & _
            > " <input type=""hidden""
            >name=""REPLY_I D"" value=""" & ReplyID & """>" & vbNewline & _
            > " <input type=""hidden""
            >name=""TOPIC_I D"" value=""" & TopicID & """>" & vbNewline & _
            > " <input type=""hidden""
            >name=""FORUM_I D"" value=""" & ForumID & """>" & vbNewline & _
            > " <input type=""hidden"" name=""CAT_ID""
            >value=""" & CatID & """>" & vbNewline & _
            > " <table border=""0"" width=""75%""
            >cellspacing="" 0"" cellpadding=""0 "">" & vbNewline & _
            > " <tr>" & vbNewline & _
            > " <td bgcolor=""" &
            >strPopUpBorder Color & """>" & vbNewline & _
            > " <table border=""0""
            >width=""100% "" cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
            > if strAuthType = "db" then
            > Response.Write " <tr>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
            >strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>User
            >Name:</font></b></td>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """><input type=""text"" name=""name"" value="""
            >& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
            > " </tr>" & vbNewline & _
            > " <tr>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
            >strDefaultFont Face & """ size=""" & strDefaultFontS ize &
            >""">Password :</font></b></td>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """><input type=""password "" name=""password ""
            >value="""" size=""20""></td>" & vbNewline & _
            > " </tr>" & vbNewline
            > else
            > Response.Write " <tr>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
            >strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>NT
            >Account:</font></b></td>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """><input type=""text"" name=""DBNTUser Name""
            >value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
            > " </tr>" & vbNewline
            > end if
            > Response.Write " <tr>" & vbNewline & _
            > " <td bgColor=""" &
            >strPopUpTableC olor & """ colspan=""2"" align=""center" "><Input
            >type=""Submit" " value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
            >& vbNewline & _
            > " </tr>" & vbNewline & _
            > " </table>" & vbNewline & _
            > " </td>" & vbNewline & _
            > " </tr>" & vbNewline & _
            > " </table>" & vbNewline & _
            > " </form>" & vbNewline
            >end if
            >'--------------- End of Code Snippet --------------------------------
            >
            >On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
            ><paulb@online. rochester.rr.co m> wrote:
            >[color=green]
            >>That's an interesting question. However, it is only the dynamic parts of the
            >>HTML that you need to worry about.
            >>
            >>The rest of it, you can put in the ASP as is simply by closing the brackets.
            >>
            >>eg.
            >>
            >><%
            >> whatever = ...
            >> Response.Write( whatever)
            >>%>
            >><form>
            >> blah blah blah
            >></form>
            >><%
            >> ...
            >>%>
            >>
            >>You can also use =expression as shorthand for writing an expression if it is
            >>the entire code within brackets.
            >>
            >>For example <%=whatever%> instead of <%Response.Writ e(whatever)%>
            >>
            >>Does that help?
            >>
            >>Paul
            >>
            >>"TinyTim" <TinyTim@MissVi cky.com> wrote in message
            >>news:ar3lh0p2 eh98lcgtn3opaar 8b0uv5j8bpi@4ax .com...[color=darkred]
            >>> I'm a newbie at ASP & HTML. It seems that when you use server side
            >>> code and you're going to return a customized HTML form with several
            >>> fields and labels, you have to do an extensive amount of
            >>> Response.Writes .
            >>>
            >>> Are there any tools that will let you design the form then convert
            >>> that form to Response.Writes that you can further customize with ASP
            >>> logic? For instance: use Dreamweaver to design the form, then another
            >>> program to convert to response.writes in an aspx file.
            >>>
            >>> What's the easy way of doing it? Just trying to make it less
            >>> laborious for me.
            >>>
            >>> Response.Write "Thanks,"
            >>>
            >>> tt
            >>>[/color]
            >>[/color][/color]

            Comment

            • Paul Baker [MVP, Windows - SDK]

              #7
              Re: Lots of Response.Writes of HTML - How do YOU do it?

              I see that you asked both myself and Dave for tutorials on this.

              I am not sure what you are getting at. You don't need a tutorial, you just
              need to learn this one thing:
              <%=expression %> is shorthand for <%Response.Writ e(expression)%>

              So, if you find yourself typing "<%Response.Wri te(expression)% >", type
              "<%=expression% >" instead. That is all there is to it. What is it you are
              unsure about?

              Paul

              "TinyTim" <TinyTim@MissVi cky.com> wrote in message
              news:jr7lh09soq j0fq14k5ofm17ir 6a39b7g2m@4ax.c om...[color=blue]
              > Can you a more complete example or tutorial? I seem to be a bit
              > thick-headed on this subject. Also please see my response to the
              > previous message in this thread.
              >
              > tt
              >
              > On Wed, 11 Aug 2004 16:56:19 -0500, "Dave Anderson"
              > <GTSPXOESSGOQ@s pammotel.com> wrote:
              >[color=green]
              > >TinyTim wrote:[color=darkred]
              > >> I'm a newbie at ASP & HTML. It seems that when you use server side
              > >> code and you're going to return a customized HTML form with several
              > >> fields and labels, you have to do an extensive amount of
              > >> Response.Writes .[/color]
              > >
              > >Are you aware that this...
              > > <%=myVar%>
              > >
              > >...is a lexical shorthand for this?
              > > <% Response.Write( myVar) %>
              > >
              > >
              > >Most of my documents are written so the HTML is a single continuous[/color][/color]
              section,[color=blue][color=green]
              > >dotted with tokens. Form element examples:
              > >
              > > <input name="LastName" value="<%=Page. LastName%>">
              > > <select name="Role"><%= Page.RoleOption List%></select>
              > > <textarea name="Comments" ><%=Page.Commen ts%></textarea>
              > >
              > >The logic for populating the variables has been abstracted away to a
              > >server-side-only segment of the script, and the above displays just fine[/color][/color]
              in[color=blue][color=green]
              > >a tool like Dreamweaver.[/color]
              >[/color]


              Comment

              • TinyTim

                #8
                Re: Lots of Response.Writes of HTML - How do YOU do it?

                Thanks,

                tt

                On Thu, 12 Aug 2004 11:01:02 +0100, Harag
                <haragREMOVETHE SECAPITALS@soft home.net> wrote:
                [color=blue]
                >On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <TinyTim@MissVi cky.com>
                >wrote:
                >[color=green]
                >>I'm looking at Snitz forum code for my examples, one of which I
                >>included in this post. Even with your described methods, it seems
                >>like a lot of work, having to design the page layout manually then
                >>putting the appropriate quote marks, underscores, etc in code.
                >>[color=darkred]
                >>>For example <%=whatever%> instead of <%Response.Writ e(whatever)%>[/color]
                >>I'll be checking this method out on one of the online tutorials. Can
                >>you point me to a specific tutorial?
                >>
                >>Thanks,
                >>
                >>tt[/color]
                >
                >Welcome to the world of web development where typing is essential :)
                >
                >I have a Include file that I include into EVERY .asp page, this file
                >has several functions that I use things like:
                >
                >out(); // I use this instead of Response.Write
                >debugOut() // this is to display variable data etc. and if I
                >forget to take it out its not shown on the live server.
                >onLocalServer( ); // this returns true if the site is running on my
                >test server
                >
                >I'll include the file below incase its of any interest to you. Note
                >that its all in JScript. Sorry for all the tabs, I can't be bothered
                >to change them to spaces. copy & paste into notepad.
                >
                >HTH
                >
                >Al
                >
                >
                ><%
                >//*************** *************** *************** *************** *************** ****
                >//* F U N C T I O N S / S U B S
                >//*************** *************** *************** *************** *************** ****
                >var g_bDebug; // t/f whether in debugging mode or not.
                >
                >//*************** *************** *************** *************** *************** ****
                >/* This function to saftly convert a VBscript array into a JS 1
                >Dimension array
                > a VBscript array will normally be returned when using the ADO
                > "Recordset.GetR ows()" method - like in the clsDBErrorCheck er.asp File
                > it adds 2 custom properties to the Jscript Array called
                >"numberOfRow s" &
                > "numberOfColumn s" if no array is return from the RS.GetRows() method
                >(eg a DBerror)
                > then it will return a "string" which this JS function detects and
                >returns an
                > array with nothing in it so check if arrayname.lengt h >0 before use.
                >*/
                >
                >function VB_JSarray(aVBA rrayFromDBCheck _OpenIntoArrayM ethod,
                >displayDebugIn fo) {
                > if (typeof aVBArrayFromDBC heck_OpenIntoAr rayMethod !=
                >'string') {
                > vbRowsArray = new
                >VBArray(aVBArr ayFromDBCheck_O penIntoArrayMet hod);
                > var numberOfColumns = vbRowsArray.ubo und(1) + 1;
                > var numberOfRows = vbRowsArray.ubo und(2) + 1;
                > var rowsArray = vbRowsArray.toA rray();
                > rowsArray.rows = numberOfRows;
                > rowsArray.cols = numberOfColumns ;
                > if (displayDebugIn fo) {
                > debugOut('{HEAD }VB_JSarray()', 'Rows=' +
                >rowsArray.rows , 'Columns=' + rowsArray.cols, 'rowsArray=' +
                >rowsArray);
                > }
                > } else {
                > var rowsArray = Array();
                > rowsArray.rows = 0;
                > rowsArray.cols = 0;
                > }
                > return rowsArray;
                >}
                >
                >
                >//*************** *************** *************** *************** *************** ****
                >// Are we in debug mode?
                >function inDebugMode() {
                > if (typeof g_bDebug == 'undefined') {
                > g_bDebug = false;
                > if (onLocalServer( ) ||
                >Request.QueryS tring('debug'). Count > 0) {
                > g_bDebug = true;
                > }
                > }
                > return g_bDebug;
                >}
                >
                >// This debug accepts any amount of arguments with no [] around the
                >text
                >// and creates a long html string accordingly to display the info.
                >function debugOut() {
                > if (inDebugMode()) {
                > var sDebugWord = 'GUBED';
                > var sOutput = sDebugWord, sText='';
                >
                > if (arguments.leng th < 1) {
                > sOutput += '<span style="backgrou nd:#555;
                >color:#CCC; font: bold italic 12px Comic Sans MS, Verdana;">{NO
                >ARGUMENTS FOR THE DEBUG FUNCTION}&nbsp; </span>';
                > } else {
                > for (var i = 0; i < arguments.lengt h; i++) {
                > sText = String(argument s[i]).trim();
                > // If blank text or <br> text then
                >display a blank line
                > if (sText && sText != '' && sText !=
                >'<br>' && sText != '\r\n') {
                > // Do the debug title.
                > if
                >(sText.toUpper Case().substrin g(0, 6) == '{HEAD}') {
                > sText =
                >sText.toUpperC ase();
                > }
                > // highlight the "=" sign.
                >This is done first as the "=" sign appears in all the
                > // properties of HTML (eg
                >style="")
                > sText = sText.replace(/=/g,
                >'<span style="font-weight:bold; color:#F90;">=</span>');
                > // If its a Header debugOut
                >then change color.
                > if (sText.substrin g(0, 6) ==
                >'{HEAD}') {
                > sText = '<span
                >style="font-weight:bold; color:#CCC;">' + sText.substring (6) +
                >'</span>';
                > }
                > // If its a highlight debugOut
                >then change the color from the default.
                > sText =
                >sText.replac e(/{HIGH}/gi, '<span style="color:#F 90; font: bold 12px
                >Verdana;">') ;
                > sText =
                >sText.replac e(/{\/HIGH}/gi, '</span>');
                >
                > // if the text isn't
                >surrounded with {...} then add the brackets to the
                > // front and the back of the
                >string
                > if (sText.charAt(0 ) != '{') {
                > sText = '{' + sText;
                > }
                > if
                >(sText.charAt( sText.length-1) != '}') {
                > sText += '}';
                > }
                >
                > // if there is no info after
                >the "=" then insert word "EMPTY"
                > sText =
                >sText.replace( '=</span>}', '=</span><span style="font: bold 12px
                >Verdana;; color:#C00;">EM PTY</span>}');
                >
                > var sText = '<span
                >style="backgro und:#555; color:#0BB; font:12px Verdana;">' + sText +
                >'&nbsp;</span>' ;
                > // If there is more than 5
                >elements then wrap the output every 5 elements.
                > if (i % 5 == 4 && i !=
                >arguments.leng th-1) {
                > sText += sDebugWord;
                > }
                > // Add the created string to
                >the total output string
                > sOutput += sText;
                > } else {
                > sOutput += '<br>';
                > }
                > }
                >
                > }
                > // Change all the [.] & {.} in the output string to a
                >differnt color so they stand
                > // out better from the rest
                > sOutput = sOutput.replace (/(\[|\])/g,'<span
                >style="font-weight:bold; color:#0CC;">$1 </span>');
                >
                > sOutput = sOutput.replace (/(\{|\})/g,'<span
                >style="font-weight:bold; color:#FC0;">$1 </span>');
                > // Change the word {DEBUG} so the debug title stands
                >out better.
                > sOutput = sOutput.replace (/GUBED/g,'<br><span
                >style="backgro und:#600; color:#C00; font: bold 12px Comic Sans MS,
                >Verdana;">&nbs p;{&nbsp;DEBUG& nbsp;}&nbsp;</span>');
                > // Output the final string.
                > out(sOutput);
                > }
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >// only display when in debug mode as defined in inDebugMode() above
                >// this is to add a touch of color to any debug strings.
                >function debugHighlight( sText) {
                > if (inDebugMode()) {
                > if (sText && sText != '') {
                > sText = '{HIGH}' + sText.trim() + '{/HIGH}';
                > }
                > }
                > return sText;
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >// Justs puts a comment to the HTML file for easy reading
                >function debugOutHeader( sHeader, bMainHeader) {
                > var sNewHead = '', sTxt;
                >
                > if (inDebugMode()) {
                > sHeader = String(sHeader) .toUpperCase() || "No Header
                >Text";
                > if (sHeader.length > 0 ) {
                > if (bMainHeader) {
                > for (var i = 0; i < sHeader.length;
                >i++) {
                > sNewHead += sHeader.charAt( i)
                >+ ' ';
                > if (sHeader.charAt (i) == ' ')
                >{
                > sNewHead += ' ';
                > }
                > }
                > sNewHead=sNewHe ad.trim();
                > sTxt = '\r\n<!--\r\n';
                > sTxt +=
                >'************* *************** *************** *************** **\r\n';
                > sTxt += '************** * ' + sNewHead
                >+ ' *************** \r\n';
                > sTxt +=
                >'************* *************** *************** *************** **\r\n';
                > sTxt += '-->\r\n';
                > } else {
                > sNewHead = sHeader;
                > sTxt = '\r\n<!-- [DebugHeader]
                >********** ' + sNewHead + ' ********** -->\r\n';
                > }
                > out(sTxt);
                > }
                > }
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >// simple wrapper for Response.Write,
                >function out(sText) {
                > Response.Write (sText);
                > if (inDebugMode()) {
                > Response.Write ('\r\n');
                > }
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >// OutJS is mainly used for outputting JS files as these are easier
                >with
                >// returns & linefeeds.
                >function outJS(sText) {
                > Response.Write (sText + '\r\n');
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >// use Response.Redire ct or Server.Transfer depending on ASP version
                >function redirect(sDesti nation) {
                > // use expensive round-trip redirect always
                > // Server.Transfer caused problems
                > Response.Redire ct (sDestination);
                >}
                >
                >
                >//*************** *************** *************** *************** *************** ****
                >// to return the html code for a transparent image of iWidth, iHeight
                >function pixelImage(iWid th, iHeight) {
                > if (iWidth < 1 || !iWidth) {
                > iWidth = 1;
                > }
                > if (iHeight < 1 || !iHeight) {
                > iHeight = 1;
                > }
                > return '<img src="/Images/Pixel.gif" width="' + iWidth + '"
                >height="' + iHeight + '" alt="" border="0">';
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >function closeWindow(bCe ntered) {
                > var sText = '';
                > if (bCentered) {
                > sText = '<div style="text-align:center; margin:10px;
                >2px;">';
                > }
                > sText += '<span class="Font01">[&nbsp;<a href="#"
                >onclick="windo w.close(); return false;">Close
                >Window</a>&nbsp;]</span>';
                > if (bCentered) {
                > sText += '</div>';
                > }
                > return sText;
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >function closeWindowAndO pener(bCentered ) {
                > var sText = '';
                > if (bCentered) {
                > sText = '<div style="text-align:center; margin:10px;
                >2px;">';
                > }
                > sText += '<span class="Font01">[&nbsp;<a href="#"
                >onclick="windo w.close(); window.opener.c lose();return false;">Close
                >Window</a>&nbsp;]</span>';
                > if (bCentered) {
                > sText += '</div>';
                > }
                > return sText;
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >function userErrorMessag e(sErrorText) {
                > // Note you need the SFX.CSS file included for this to look
                >right.
                > return '<div class="bg900 Bordered Font02" style="padding: 0em
                >1em; text-indent: -1em;"><span class="bg600 Font04" style="color:#C 00;
                >font-weight: bold;">&nbsp;ER ROR:&nbsp;</span>&nbsp;' + sErrorText +
                >'</div>';
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >// Convert a string to a Base10 number, if it cannot be converted then
                >return
                >// the devault value. This is used to make sure that input from web
                >forms are
                >// actually numbers and not string... eg Age, quantity. etc.
                >function convertToNumber (sString, iDefault) {
                > var iNewVal = parseFloat(sStr ing, 10) || iDefault || 0;
                > sString = (''+sString).to LowerCase();
                >
                > if (sString == 'true' || sString == 'yes' || sString == 'on')
                >{
                > iNewVal = true;
                > }
                > if (sString == 'false' || sString == 'no' || sString == 'off')
                >{
                > iNewVal = false;
                > }
                > if (isNaN(iNewVal) ) {
                > iNewVal = iDefault;
                > }
                > return iNewVal;
                >}
                >
                >//*************** *************** *************** *************** *************** ****
                >//*************** *************** *************** *************** *************** ****
                >//*************** *************** *************** *************** *************** ****
                >//*************** *************** *************** *************** *************** ****
                >//*************** *************** *************** *************** *************** ****
                >%>
                >
                >
                >[color=green]
                >>
                >>'--------------- Code Snippet Follows --------------------------------
                >>else
                >> Response.Write " <p><font face=""" & strDefaultFontF ace
                >>& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
                >>change another users subscription. Only Administrators may change
                >>another users subscriptions.</font></p>" & vbNewline
                >>
                >> ' ## This is just the form which is used to login if the
                >>person is
                >> ' ## not logged in or does not have access to do the
                >>moderation.
                >> Response.Write " <form
                >>action=""pop_ subscription.as p?UserCheck=Y"" method=""post""
                >>id=""Form1" " name=""Form1""> " & vbNewline & _
                >> " <input type=""hidden""
                >>name=""REPLY_ ID"" value=""" & ReplyID & """>" & vbNewline & _
                >> " <input type=""hidden""
                >>name=""TOPIC_ ID"" value=""" & TopicID & """>" & vbNewline & _
                >> " <input type=""hidden""
                >>name=""FORUM_ ID"" value=""" & ForumID & """>" & vbNewline & _
                >> " <input type=""hidden"" name=""CAT_ID""
                >>value=""" & CatID & """>" & vbNewline & _
                >> " <table border=""0"" width=""75%""
                >>cellspacing=" "0"" cellpadding=""0 "">" & vbNewline & _
                >> " <tr>" & vbNewline & _
                >> " <td bgcolor=""" &
                >>strPopUpBorde rColor & """>" & vbNewline & _
                >> " <table border=""0""
                >>width=""100%" " cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
                >> if strAuthType = "db" then
                >> Response.Write " <tr>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """ align=""right"" nowrap><b><font face=""" &
                >>strDefaultFon tFace & """ size=""" & strDefaultFontS ize & """>User
                >>Name:</font></b></td>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """><input type=""text"" name=""name"" value="""
                >>& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
                >> " </tr>" & vbNewline & _
                >> " <tr>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """ align=""right"" nowrap><b><font face=""" &
                >>strDefaultFon tFace & """ size=""" & strDefaultFontS ize &
                >>""">Password: </font></b></td>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """><input type=""password "" name=""password ""
                >>value="""" size=""20""></td>" & vbNewline & _
                >> " </tr>" & vbNewline
                >> else
                >> Response.Write " <tr>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """ align=""right"" nowrap><b><font face=""" &
                >>strDefaultFon tFace & """ size=""" & strDefaultFontS ize & """>NT
                >>Account:</font></b></td>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """><input type=""text"" name=""DBNTUser Name""
                >>value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
                >> " </tr>" & vbNewline
                >> end if
                >> Response.Write " <tr>" & vbNewline & _
                >> " <td bgColor=""" &
                >>strPopUpTable Color & """ colspan=""2"" align=""center" "><Input
                >>type=""Submit "" value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
                >>& vbNewline & _
                >> " </tr>" & vbNewline & _
                >> " </table>" & vbNewline & _
                >> " </td>" & vbNewline & _
                >> " </tr>" & vbNewline & _
                >> " </table>" & vbNewline & _
                >> " </form>" & vbNewline
                >>end if
                >>'--------------- End of Code Snippet --------------------------------
                >>
                >>On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
                >><paulb@online .rochester.rr.c om> wrote:
                >>[color=darkred]
                >>>That's an interesting question. However, it is only the dynamic parts of the
                >>>HTML that you need to worry about.
                >>>
                >>>The rest of it, you can put in the ASP as is simply by closing the brackets.
                >>>
                >>>eg.
                >>>
                >>><%
                >>> whatever = ...
                >>> Response.Write( whatever)
                >>>%>
                >>><form>
                >>> blah blah blah
                >>></form>
                >>><%
                >>> ...
                >>>%>
                >>>
                >>>You can also use =expression as shorthand for writing an expression if it is
                >>>the entire code within brackets.
                >>>
                >>>For example <%=whatever%> instead of <%Response.Writ e(whatever)%>
                >>>
                >>>Does that help?
                >>>
                >>>Paul
                >>>
                >>>"TinyTim" <TinyTim@MissVi cky.com> wrote in message
                >>>news:ar3lh0p 2eh98lcgtn3opaa r8b0uv5j8bpi@4a x.com...
                >>>> I'm a newbie at ASP & HTML. It seems that when you use server side
                >>>> code and you're going to return a customized HTML form with several
                >>>> fields and labels, you have to do an extensive amount of
                >>>> Response.Writes .
                >>>>
                >>>> Are there any tools that will let you design the form then convert
                >>>> that form to Response.Writes that you can further customize with ASP
                >>>> logic? For instance: use Dreamweaver to design the form, then another
                >>>> program to convert to response.writes in an aspx file.
                >>>>
                >>>> What's the easy way of doing it? Just trying to make it less
                >>>> laborious for me.
                >>>>
                >>>> Response.Write "Thanks,"
                >>>>
                >>>> tt
                >>>>
                >>>[/color][/color][/color]

                Comment

                • TinyTim

                  #9
                  Re: Lots of Response.Writes of HTML - How do YOU do it?

                  On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
                  <paulb@online.r ochester.rr.com > wrote:
                  [color=blue]
                  >I see that you asked both myself and Dave for tutorials on this.
                  >
                  >I am not sure what you are getting at. You don't need a tutorial, you just
                  >need to learn this one thing:
                  ><%=expression% > is shorthand for <%Response.Writ e(expression)%>
                  >
                  >So, if you find yourself typing "<%Response.Wri te(expression)% >", type
                  >"<%=expression %>" instead. That is all there is to it. What is it you are
                  >unsure about?
                  >
                  >Paul
                  >[/color]
                  Paul,

                  OK, let me give you a scenerio.

                  The user is on my site. Types in a user-id and password and selects a
                  radio button item using choice 1 out of three. Because of his
                  selection, he needs to fill out a specialized form (all forms are
                  similar but not exactly the same).

                  So when he presses the submit button transfer is made to the server
                  asp page which then processes his request by: searching a database
                  for items to populate a dropdown list, calculate a value, place
                  various data fields and labels on the form, and request verification
                  and selection of the information.

                  Based on his original selection (lets say Fishing, Hiking and Hunting)
                  information will be displayed back to the user.

                  There will be non-HTML-display code in the server page to do file
                  handling, calculations, etc.

                  My thought was if I could design the complete page to be returned from
                  the asp code in DW, convert the entire page to response.writes then
                  just insert the functioning code within that page, this would be the
                  simplest way.

                  I would get the benefit of having a visual page designer combined with
                  the power of asp. Having to design/format a page with 15 - 20
                  controls properly positioned by hand seems a bit daunting to this
                  newbie.

                  Am I just making this more difficult than necessary?

                  Thanks for your patience,

                  tt

                  Comment

                  • Jeff Cochran

                    #10
                    Re: Lots of Response.Writes of HTML - How do YOU do it?

                    On Wed, 11 Aug 2004 15:35:42 -0700, TinyTim <TinyTim@MissVi cky.com>
                    wrote:
                    [color=blue]
                    >I'm looking at Snitz forum code for my examples, one of which I
                    >included in this post. Even with your described methods, it seems
                    >like a lot of work, having to design the page layout manually then
                    >putting the appropriate quote marks, underscores, etc in code.[/color]

                    Run, don't walk, to the nearest Burger King and beg for a job. If
                    you're doing web programming, especially in ASP, you're going to have
                    to do some work.

                    Might want to switch to ASP.NET as an alternative.

                    Jeff

                    [color=blue][color=green]
                    >>For example <%=whatever%> instead of <%Response.Writ e(whatever)%>[/color]
                    >I'll be checking this method out on one of the online tutorials. Can
                    >you point me to a specific tutorial?
                    >
                    >Thanks,
                    >
                    >tt
                    >
                    >'--------------- Code Snippet Follows --------------------------------
                    >else
                    > Response.Write " <p><font face=""" & strDefaultFontF ace
                    >& """ size=""" & strHeaderFontSi ze & """>You do not have permission to
                    >change another users subscription. Only Administrators may change
                    >another users subscriptions.</font></p>" & vbNewline
                    >
                    > ' ## This is just the form which is used to login if the
                    >person is
                    > ' ## not logged in or does not have access to do the
                    >moderation.
                    > Response.Write " <form
                    >action=""pop_s ubscription.asp ?UserCheck=Y"" method=""post""
                    >id=""Form1"" name=""Form1""> " & vbNewline & _
                    > " <input type=""hidden""
                    >name=""REPLY_I D"" value=""" & ReplyID & """>" & vbNewline & _
                    > " <input type=""hidden""
                    >name=""TOPIC_I D"" value=""" & TopicID & """>" & vbNewline & _
                    > " <input type=""hidden""
                    >name=""FORUM_I D"" value=""" & ForumID & """>" & vbNewline & _
                    > " <input type=""hidden"" name=""CAT_ID""
                    >value=""" & CatID & """>" & vbNewline & _
                    > " <table border=""0"" width=""75%""
                    >cellspacing="" 0"" cellpadding=""0 "">" & vbNewline & _
                    > " <tr>" & vbNewline & _
                    > " <td bgcolor=""" &
                    >strPopUpBorder Color & """>" & vbNewline & _
                    > " <table border=""0""
                    >width=""100% "" cellspacing=""1 "" cellpadding=""1 "">" & vbNewline
                    > if strAuthType = "db" then
                    > Response.Write " <tr>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
                    >strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>User
                    >Name:</font></b></td>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """><input type=""text"" name=""name"" value="""
                    >& strDBNTUserName & """ size=""20""></td>" & vbNewline & _
                    > " </tr>" & vbNewline & _
                    > " <tr>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
                    >strDefaultFont Face & """ size=""" & strDefaultFontS ize &
                    >""">Password :</font></b></td>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """><input type=""password "" name=""password ""
                    >value="""" size=""20""></td>" & vbNewline & _
                    > " </tr>" & vbNewline
                    > else
                    > Response.Write " <tr>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """ align=""right"" nowrap><b><font face=""" &
                    >strDefaultFont Face & """ size=""" & strDefaultFontS ize & """>NT
                    >Account:</font></b></td>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """><input type=""text"" name=""DBNTUser Name""
                    >value=""" & strDBNTUserName & """ size=""20""></td>" & vbNewline & _
                    > " </tr>" & vbNewline
                    > end if
                    > Response.Write " <tr>" & vbNewline & _
                    > " <td bgColor=""" &
                    >strPopUpTableC olor & """ colspan=""2"" align=""center" "><Input
                    >type=""Submit" " value=""Send"" id=""Submit1"" name=""Submit1" "></td>"
                    >& vbNewline & _
                    > " </tr>" & vbNewline & _
                    > " </table>" & vbNewline & _
                    > " </td>" & vbNewline & _
                    > " </tr>" & vbNewline & _
                    > " </table>" & vbNewline & _
                    > " </form>" & vbNewline
                    >end if
                    >'--------------- End of Code Snippet --------------------------------
                    >
                    >On Wed, 11 Aug 2004 17:35:18 -0400, "Paul Baker [MVP, Windows - SDK]"
                    ><paulb@online. rochester.rr.co m> wrote:
                    >[color=green]
                    >>That's an interesting question. However, it is only the dynamic parts of the
                    >>HTML that you need to worry about.
                    >>
                    >>The rest of it, you can put in the ASP as is simply by closing the brackets.
                    >>
                    >>eg.
                    >>
                    >><%
                    >> whatever = ...
                    >> Response.Write( whatever)
                    >>%>
                    >><form>
                    >> blah blah blah
                    >></form>
                    >><%
                    >> ...
                    >>%>
                    >>
                    >>You can also use =expression as shorthand for writing an expression if it is
                    >>the entire code within brackets.
                    >>
                    >>For example <%=whatever%> instead of <%Response.Writ e(whatever)%>
                    >>
                    >>Does that help?
                    >>
                    >>Paul
                    >>
                    >>"TinyTim" <TinyTim@MissVi cky.com> wrote in message
                    >>news:ar3lh0p2 eh98lcgtn3opaar 8b0uv5j8bpi@4ax .com...[color=darkred]
                    >>> I'm a newbie at ASP & HTML. It seems that when you use server side
                    >>> code and you're going to return a customized HTML form with several
                    >>> fields and labels, you have to do an extensive amount of
                    >>> Response.Writes .
                    >>>
                    >>> Are there any tools that will let you design the form then convert
                    >>> that form to Response.Writes that you can further customize with ASP
                    >>> logic? For instance: use Dreamweaver to design the form, then another
                    >>> program to convert to response.writes in an aspx file.
                    >>>
                    >>> What's the easy way of doing it? Just trying to make it less
                    >>> laborious for me.
                    >>>
                    >>> Response.Write "Thanks,"
                    >>>
                    >>> tt
                    >>>[/color]
                    >>[/color][/color]

                    Comment

                    • Jeff Cochran

                      #11
                      Re: Lots of Response.Writes of HTML - How do YOU do it?

                      On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <TinyTim@MissVi cky.com>
                      wrote:
                      [color=blue]
                      >On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
                      ><paulb@online. rochester.rr.co m> wrote:
                      >[color=green]
                      >>I see that you asked both myself and Dave for tutorials on this.
                      >>
                      >>I am not sure what you are getting at. You don't need a tutorial, you just
                      >>need to learn this one thing:
                      >><%=expression %> is shorthand for <%Response.Writ e(expression)%>
                      >>
                      >>So, if you find yourself typing "<%Response.Wri te(expression)% >", type
                      >>"<%=expressio n%>" instead. That is all there is to it. What is it you are
                      >>unsure about?
                      >>
                      >>Paul
                      >>[/color]
                      >Paul,
                      >
                      >OK, let me give you a scenerio.
                      >
                      >The user is on my site. Types in a user-id and password and selects a
                      >radio button item using choice 1 out of three. Because of his
                      >selection, he needs to fill out a specialized form (all forms are
                      >similar but not exactly the same).
                      >
                      >So when he presses the submit button transfer is made to the server
                      >asp page which then processes his request by: searching a database
                      >for items to populate a dropdown list, calculate a value, place
                      >various data fields and labels on the form, and request verification
                      >and selection of the information.
                      >
                      >Based on his original selection (lets say Fishing, Hiking and Hunting)
                      >information will be displayed back to the user.
                      >
                      >There will be non-HTML-display code in the server page to do file
                      >handling, calculations, etc.
                      >
                      >My thought was if I could design the complete page to be returned from
                      >the asp code in DW, convert the entire page to response.writes then
                      >just insert the functioning code within that page, this would be the
                      >simplest way.
                      >
                      >I would get the benefit of having a visual page designer combined with
                      >the power of asp. Having to design/format a page with 15 - 20
                      >controls properly positioned by hand seems a bit daunting to this
                      >newbie.
                      >
                      >Am I just making this more difficult than necessary?[/color]

                      Many would argue your making use of DreamWeaver is what's making
                      things harder for you. :)

                      Create your page in DreamWeaver, as you want it, then insert the
                      relevant ASP codes. DW does databases just fine on it's own (okay,
                      fine for DreamWeaver users, for coders it's bloated and
                      inefficient...) . You may not even need to write code.

                      Jeff

                      Comment

                      • Paul Baker [MVP, Windows - SDK]

                        #12
                        Re: Lots of Response.Writes of HTML - How do YOU do it?

                        We use DreamWeaver. Well our company. I do not.

                        I use a little something called Notepad. It might save you some
                        complication.

                        Paul

                        "Jeff Cochran" <jeff.nospam@zi na.com> wrote in message
                        news:4122b288.2 018352@msnews.m icrosoft.com...[color=blue]
                        > On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <TinyTim@MissVi cky.com>
                        > wrote:
                        >[color=green]
                        > >On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
                        > ><paulb@online. rochester.rr.co m> wrote:
                        > >[color=darkred]
                        > >>I see that you asked both myself and Dave for tutorials on this.
                        > >>
                        > >>I am not sure what you are getting at. You don't need a tutorial, you[/color][/color][/color]
                        just[color=blue][color=green][color=darkred]
                        > >>need to learn this one thing:
                        > >><%=expression %> is shorthand for <%Response.Writ e(expression)%>
                        > >>
                        > >>So, if you find yourself typing "<%Response.Wri te(expression)% >", type
                        > >>"<%=expressio n%>" instead. That is all there is to it. What is it you[/color][/color][/color]
                        are[color=blue][color=green][color=darkred]
                        > >>unsure about?
                        > >>
                        > >>Paul
                        > >>[/color]
                        > >Paul,
                        > >
                        > >OK, let me give you a scenerio.
                        > >
                        > >The user is on my site. Types in a user-id and password and selects a
                        > >radio button item using choice 1 out of three. Because of his
                        > >selection, he needs to fill out a specialized form (all forms are
                        > >similar but not exactly the same).
                        > >
                        > >So when he presses the submit button transfer is made to the server
                        > >asp page which then processes his request by: searching a database
                        > >for items to populate a dropdown list, calculate a value, place
                        > >various data fields and labels on the form, and request verification
                        > >and selection of the information.
                        > >
                        > >Based on his original selection (lets say Fishing, Hiking and Hunting)
                        > >information will be displayed back to the user.
                        > >
                        > >There will be non-HTML-display code in the server page to do file
                        > >handling, calculations, etc.
                        > >
                        > >My thought was if I could design the complete page to be returned from
                        > >the asp code in DW, convert the entire page to response.writes then
                        > >just insert the functioning code within that page, this would be the
                        > >simplest way.
                        > >
                        > >I would get the benefit of having a visual page designer combined with
                        > >the power of asp. Having to design/format a page with 15 - 20
                        > >controls properly positioned by hand seems a bit daunting to this
                        > >newbie.
                        > >
                        > >Am I just making this more difficult than necessary?[/color]
                        >
                        > Many would argue your making use of DreamWeaver is what's making
                        > things harder for you. :)
                        >
                        > Create your page in DreamWeaver, as you want it, then insert the
                        > relevant ASP codes. DW does databases just fine on it's own (okay,
                        > fine for DreamWeaver users, for coders it's bloated and
                        > inefficient...) . You may not even need to write code.
                        >
                        > Jeff[/color]


                        Comment

                        • Harag

                          #13
                          Re: Lots of Response.Writes of HTML - How do YOU do it?

                          On Fri, 13 Aug 2004 10:30:09 -0400, "Paul Baker [MVP, Windows - SDK]"
                          <paulb@online.r ochester.rr.com > wrote:
                          [color=blue]
                          >We use DreamWeaver. Well our company. I do not.
                          >
                          >I use a little something called Notepad. It might save you some
                          >complication .
                          >
                          >Paul
                          >[/color]


                          lol, I use dreamweaver MX but I don't use any of its "Coding"
                          features, I use it mainly for project files, remote/testing server
                          syncronising(sp ) uploading files to server, and the colo(u)r coding of
                          the code I like to do my comment lines with light green on drk green
                          backgrounds so I can have a line of stars /*************** */ between
                          each function so they stand out as I scroll down. I also find it
                          easier to "learn" when I actually name the variables I want rather
                          than a load called MM_daftname etc.

                          IMHO

                          AL.

                          [color=blue]
                          >"Jeff Cochran" <jeff.nospam@zi na.com> wrote in message
                          >news:4122b288. 2018352@msnews. microsoft.com.. .[color=green]
                          >> On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <TinyTim@MissVi cky.com>
                          >> wrote:
                          >>[color=darkred]
                          >> >On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
                          >> ><paulb@online. rochester.rr.co m> wrote:
                          >> >
                          >> >>I see that you asked both myself and Dave for tutorials on this.
                          >> >>
                          >> >>I am not sure what you are getting at. You don't need a tutorial, you[/color][/color]
                          >just[color=green][color=darkred]
                          >> >>need to learn this one thing:
                          >> >><%=expression %> is shorthand for <%Response.Writ e(expression)%>
                          >> >>
                          >> >>So, if you find yourself typing "<%Response.Wri te(expression)% >", type
                          >> >>"<%=expressio n%>" instead. That is all there is to it. What is it you[/color][/color]
                          >are[color=green][color=darkred]
                          >> >>unsure about?
                          >> >>
                          >> >>Paul
                          >> >>
                          >> >Paul,
                          >> >
                          >> >OK, let me give you a scenerio.
                          >> >
                          >> >The user is on my site. Types in a user-id and password and selects a
                          >> >radio button item using choice 1 out of three. Because of his
                          >> >selection, he needs to fill out a specialized form (all forms are
                          >> >similar but not exactly the same).
                          >> >
                          >> >So when he presses the submit button transfer is made to the server
                          >> >asp page which then processes his request by: searching a database
                          >> >for items to populate a dropdown list, calculate a value, place
                          >> >various data fields and labels on the form, and request verification
                          >> >and selection of the information.
                          >> >
                          >> >Based on his original selection (lets say Fishing, Hiking and Hunting)
                          >> >information will be displayed back to the user.
                          >> >
                          >> >There will be non-HTML-display code in the server page to do file
                          >> >handling, calculations, etc.
                          >> >
                          >> >My thought was if I could design the complete page to be returned from
                          >> >the asp code in DW, convert the entire page to response.writes then
                          >> >just insert the functioning code within that page, this would be the
                          >> >simplest way.
                          >> >
                          >> >I would get the benefit of having a visual page designer combined with
                          >> >the power of asp. Having to design/format a page with 15 - 20
                          >> >controls properly positioned by hand seems a bit daunting to this
                          >> >newbie.
                          >> >
                          >> >Am I just making this more difficult than necessary?[/color]
                          >>
                          >> Many would argue your making use of DreamWeaver is what's making
                          >> things harder for you. :)
                          >>
                          >> Create your page in DreamWeaver, as you want it, then insert the
                          >> relevant ASP codes. DW does databases just fine on it's own (okay,
                          >> fine for DreamWeaver users, for coders it's bloated and
                          >> inefficient...) . You may not even need to write code.
                          >>
                          >> Jeff[/color]
                          >[/color]

                          Comment

                          • Paul Baker [MVP, Windows - SDK]

                            #14
                            Re: Lots of Response.Writes of HTML - How do YOU do it?

                            I use StarTeam (was Starbase, now owned by Borland) to do the version
                            control on the parts of the web site I modify. That is why I don't need
                            DreamWeaver for that sort of thing, as you mention.

                            Paul

                            "Harag" <haragREMOVETHE SECAPITALS@soft home.net> wrote in message
                            news:7nvph094e2 dn11pgje4f279fn s7mtpfem7@4ax.c om...[color=blue]
                            > On Fri, 13 Aug 2004 10:30:09 -0400, "Paul Baker [MVP, Windows - SDK]"
                            > <paulb@online.r ochester.rr.com > wrote:
                            >[color=green]
                            > >We use DreamWeaver. Well our company. I do not.
                            > >
                            > >I use a little something called Notepad. It might save you some
                            > >complication .
                            > >
                            > >Paul
                            > >[/color]
                            >
                            >
                            > lol, I use dreamweaver MX but I don't use any of its "Coding"
                            > features, I use it mainly for project files, remote/testing server
                            > syncronising(sp ) uploading files to server, and the colo(u)r coding of
                            > the code I like to do my comment lines with light green on drk green
                            > backgrounds so I can have a line of stars /*************** */ between
                            > each function so they stand out as I scroll down. I also find it
                            > easier to "learn" when I actually name the variables I want rather
                            > than a load called MM_daftname etc.
                            >
                            > IMHO
                            >
                            > AL.
                            >
                            >[color=green]
                            > >"Jeff Cochran" <jeff.nospam@zi na.com> wrote in message
                            > >news:4122b288. 2018352@msnews. microsoft.com.. .[color=darkred]
                            > >> On Thu, 12 Aug 2004 16:10:20 -0700, TinyTim <TinyTim@MissVi cky.com>
                            > >> wrote:
                            > >>
                            > >> >On Thu, 12 Aug 2004 16:23:16 -0400, "Paul Baker [MVP, Windows - SDK]"
                            > >> ><paulb@online. rochester.rr.co m> wrote:
                            > >> >
                            > >> >>I see that you asked both myself and Dave for tutorials on this.
                            > >> >>
                            > >> >>I am not sure what you are getting at. You don't need a tutorial, you[/color]
                            > >just[color=darkred]
                            > >> >>need to learn this one thing:
                            > >> >><%=expression %> is shorthand for <%Response.Writ e(expression)%>
                            > >> >>
                            > >> >>So, if you find yourself typing "<%Response.Wri te(expression)% >",[/color][/color][/color]
                            type[color=blue][color=green][color=darkred]
                            > >> >>"<%=expressio n%>" instead. That is all there is to it. What is it you[/color]
                            > >are[color=darkred]
                            > >> >>unsure about?
                            > >> >>
                            > >> >>Paul
                            > >> >>
                            > >> >Paul,
                            > >> >
                            > >> >OK, let me give you a scenerio.
                            > >> >
                            > >> >The user is on my site. Types in a user-id and password and selects a
                            > >> >radio button item using choice 1 out of three. Because of his
                            > >> >selection, he needs to fill out a specialized form (all forms are
                            > >> >similar but not exactly the same).
                            > >> >
                            > >> >So when he presses the submit button transfer is made to the server
                            > >> >asp page which then processes his request by: searching a database
                            > >> >for items to populate a dropdown list, calculate a value, place
                            > >> >various data fields and labels on the form, and request verification
                            > >> >and selection of the information.
                            > >> >
                            > >> >Based on his original selection (lets say Fishing, Hiking and Hunting)
                            > >> >information will be displayed back to the user.
                            > >> >
                            > >> >There will be non-HTML-display code in the server page to do file
                            > >> >handling, calculations, etc.
                            > >> >
                            > >> >My thought was if I could design the complete page to be returned from
                            > >> >the asp code in DW, convert the entire page to response.writes then
                            > >> >just insert the functioning code within that page, this would be the
                            > >> >simplest way.
                            > >> >
                            > >> >I would get the benefit of having a visual page designer combined with
                            > >> >the power of asp. Having to design/format a page with 15 - 20
                            > >> >controls properly positioned by hand seems a bit daunting to this
                            > >> >newbie.
                            > >> >
                            > >> >Am I just making this more difficult than necessary?
                            > >>
                            > >> Many would argue your making use of DreamWeaver is what's making
                            > >> things harder for you. :)
                            > >>
                            > >> Create your page in DreamWeaver, as you want it, then insert the
                            > >> relevant ASP codes. DW does databases just fine on it's own (okay,
                            > >> fine for DreamWeaver users, for coders it's bloated and
                            > >> inefficient...) . You may not even need to write code.
                            > >>
                            > >> Jeff[/color]
                            > >[/color]
                            >[/color]


                            Comment

                            Working...