Easier way to Response.write HTML?

Results 1 to 7 of 7

Thread: Easier way to Response.write HTML?

  1. #1
    Jeremy Green Guest

    Default Easier way to Response.write HTML?

    I have an ASP script that depending on a condition uses response.write to output 1 of 2 forms. Basically it&#039;s just 2 different HTML pages. Instead of writing a million response.writes is there a function or tag that will let me type in pure html? It&#039;s just a pain because of the number of lines and the number of quotation marks I have to deal with. If anyone knows of an easier way please pass it on!<BR><BR>JG

  2. #2
    Join Date
    Dec 1969

    Default Close and re-open your ASP tags...

    All you have to do is close and re-open your ASP tags.. eg...<BR><BR>&#060;% if bla blah = blah blah then<BR>%&#062;<BR>&#060;b&#062;You can enter raw html&#060;/b&#062;<BR>&#060;%<BR>else<BR>response.write("Or you can code it in ASP")<BR>end if<BR>%&#062;<BR><BR>Whatever is outside your ASP is raw HTML, anything inside the ASP is ASP...<BR><BR>Outside &#060;% response.write("inside") %&#062; Outside<BR><BR>If you have all of your variables set you can also just dynamically include them in your HTML like this...<BR><BR>&#060;%<BR>Message = "hello"<BR>%&#062;<BR>The message of today is &#060;%=Message%&#062;.<BR><BR>This will display "The message of today is hello."<BR><BR>Give it a try...<BR>-- Whol

  3. #3
    RDM Guest

    Default Performance Hit...

    This practice should really be avoided if possible. It makes IIS work much harder than should have to.

  4. #4
    Join Date
    Dec 1969
    Los Angeles, CA

    Default SLIGHT Performance Hit...

    honestly i do not jump between the 2 but it is not really THAT big a deal. <BR><BR>Yes if you are developing a site where you hope to get a lot of traffic every second you should definitely avoid it on the other hand you could just do it and not "really" worry

  5. #5
    RDM Guest

    Default If abused, it's a big deal...

    ...A little here and there for a specific purpose is not a big deal. But, if your web server has a lot of other processes running on them, it can definitely be an impact if this practice is used as the example here showed.<BR><BR>My rule of thumb has always been to be as efficient as possible to avoid performance problems when the environment on the server changes. &#039;Cause it undoubtedly will...

  6. #6
    Join Date
    Dec 1969

    Default I answered his question...

    He asked if it could be done, and I said it was possible ;) I didan&#039;t say it was a good idea, hell my code is nothing buy a boat load of response.writes....<BR>-- Whol

  7. #7
    RDM Guest

    Default Chuckle...This is true. You did not comment on pe


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts