Decision making

Results 1 to 2 of 2

Thread: Decision making

  1. #1
    Join Date
    Dec 1969

    Default Decision making

    Many times when you design a dynamic site you are going to make logical decisions in the code about what to place on a certain part of the page. For example, and auction page I&#039m working on can have an extreme amount of possibilities for just one section. Are they logged in? If so, place "Log Out" not "Log In" just stuff like that. Would it be better to have numerous &#060;%= %&#062; tags placed around the page, or response.write it all out?<BR><BR>I&#039m sure someone has run into this dilemma, of course it can be solved many ways, however, I’m just interested in the best way.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Decision making

    Having embedded &#060;% %&#062;&#039s is referred to as context switching, and is not very efficient. The price is minimal, however, and not really noticed unless you have a large loop that does something like:<BR><BR>&#060;% For x = 1 to 10000 %&#062;<BR> Hello<BR><BR>&#060;% Next %&#062;<BR><BR>That context switch, from an ASP code block to an HTML block, is less efficient than:<BR><BR>&#060;% For x = 1 to 10000<BR> Response.Write "Hello<BR>" & vbCrLf<BR>Next %&#062;<BR><BR>So, strive to have as few &#060;% and %&#062;&#039s as possible. However, don&#039t fret over it too much, unless there are context switches in loops.<BR><BR>Have a great day!

Posting Permissions

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