arrange page heading code

Discussion in 'ASP General' started by shank, Oct 12, 2003.

  1. shank

    shank Guest

    Is there anything technically wrong with the way I have the below code
    arranged? It works, but is not how I am used to seeing page headings layed
    out.
    thanks!

    <%@LANGUAGE="VBSCRIPT"%>
    <% response.buffer = true %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <!--#include file="Connections/dbconnect.asp" -->
    <%
    sname = UCASE(Request.ServerVariables("SERVER_NAME"))
    If InStr(sname,"NEWRELEASES") <> 0 then
    response.redirect "http://www.mydomain.com/newproduct/"
    ElseIf InStr(sname,"SPECIALS") <> 0 then
    response.redirect "http://www.mydomain.com/specials/"
    End If
    %>
    <html>
    blah blah blah....
     
    shank, Oct 12, 2003
    #1
    1. Advertising

  2. shank

    Evertjan. Guest

    shank wrote on 12 okt 2003 in microsoft.public.inetserver.asp.general:

    > Is there anything technically wrong with the way I have the below code
    > arranged? It works, but is not how I am used to seeing page headings
    > layed out.
    > thanks!
    >
    > <%@LANGUAGE="VBSCRIPT"%>
    > <% response.buffer = true %>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    > <!--#include file="Connections/dbconnect.asp" -->
    > <%
    > sname = UCASE(Request.ServerVariables("SERVER_NAME"))
    > If InStr(sname,"NEWRELEASES") <> 0 then
    > response.redirect "http://www.mydomain.com/newproduct/"
    > ElseIf InStr(sname,"SPECIALS") <> 0 then
    > response.redirect "http://www.mydomain.com/specials/"
    > End If
    > %>
    > <html>
    > blah blah blah....


    I would do the redirects first,
    anyway before any output to clientside,
    wich the DOCTYPE declaration is.
    [In your version are only saved by the buffering.]
    If you are only writing for your own machine [set on vbs],
    I could do without the langage declaration.

    ===================================

    <%@LANGUAGE="VBSCRIPT"%>
    <%
    sname = UCASE(Request.ServerVariables("SERVER_NAME"))
    If InStr(sname,"NEWRELEASES") <> 0 then
    response.redirect "http://www.mydomain.com/newproduct/"
    ElseIf InStr(sname,"SPECIALS") <> 0 then
    response.redirect "http://www.mydomain.com/specials/"
    End If
    %>
    <% response.buffer = true %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <!--#include file="Connections/dbconnect.asp" -->
    <html>
    blah blah blah....



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Oct 12, 2003
    #2
    1. Advertising

  3. shank

    Ken Schaefer Guest

    My style is

    a) anything in an include needs to be in an function or sub - no inline
    code, no HTML

    b)

    <% @ Declarations here, eg Language=VBScript %>
    <%
    Option Explicit
    %>
    <!-- #include files go here -->
    <!-- #include files go here -->
    <%
    ' Now do your response redirects if required:
    sname = UCASE(Request.ServerVariables("SERVER_NAME"))

    If InStr(sname,"NEWRELEASES") <> 0 then
    response.redirect "http://www.mydomain.com/newproduct/"
    ElseIf InStr(sname,"SPECIALS") <> 0 then
    response.redirect "http://www.mydomain.com/specials/"
    End If
    %>

    <! DOCTYPE= >
    <html>
    HTML content here
    </html>

    Cheers
    Ken


    "shank" <> wrote in message
    news:OfL%...
    : Is there anything technically wrong with the way I have the below code
    : arranged? It works, but is not how I am used to seeing page headings layed
    : out.
    : thanks!
    :
    : <%@LANGUAGE="VBSCRIPT"%>
    : <% response.buffer = true %>
    : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    : <!--#include file="Connections/dbconnect.asp" -->
    : <%
    : sname = UCASE(Request.ServerVariables("SERVER_NAME"))
    : If InStr(sname,"NEWRELEASES") <> 0 then
    : response.redirect "http://www.mydomain.com/newproduct/"
    : ElseIf InStr(sname,"SPECIALS") <> 0 then
    : response.redirect "http://www.mydomain.com/specials/"
    : End If
    : %>
    : <html>
    : blah blah blah....
    :
    :
     
    Ken Schaefer, Oct 13, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack
    Replies:
    2
    Views:
    558
  2. Luca Fini

    help on how to arrange python code

    Luca Fini, Oct 18, 2003, in forum: Python
    Replies:
    0
    Views:
    438
    Luca Fini
    Oct 18, 2003
  3. PraVeeN

    Gridview columns re-arrange

    PraVeeN, Dec 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    399
    PraVeeN
    Dec 8, 2006
  4. David Segall

    How to align text in my page heading?

    David Segall, Dec 2, 2007, in forum: HTML
    Replies:
    23
    Views:
    910
    dorayme
    Dec 7, 2007
  5. James Harris

    How to arrange many files of C source code

    James Harris, Mar 2, 2013, in forum: C Programming
    Replies:
    22
    Views:
    619
    Jorgen Grahn
    Mar 14, 2013
Loading...

Share This Page