Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > arrange page heading code

Reply
Thread Tools

arrange page heading code

 
 
shank
Guest
Posts: n/a
 
      10-12-2003
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....


 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      10-12-2003
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)
 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      10-13-2003
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" <(E-Mail Removed)> wrote in message
news:OfL%(E-Mail Removed)...
: 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....
:
:


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to arrange many files of C source code James Harris C Programming 22 03-14-2013 07:25 PM
How to align text in my page heading? David Segall HTML 23 12-07-2007 09:10 PM
DataGrid Heading =?Utf-8?B?SmltIEhlYXZleQ==?= ASP .Net 3 12-10-2004 08:23 PM
Arrange emails + posts by thread? URAQT2 Firefox 9 02-24-2004 06:15 AM
help on how to arrange python code Luca Fini Python 0 10-18-2003 01:02 PM



Advertisments