calling an include file from the default.asp

Results 1 to 2 of 2

Thread: calling an include file from the default.asp

  1. #1
    Sharon Guest

    Default calling an include file from the default.asp

    I am setting up a site where the user can choose from 2 different motifs for the layout of their website. The user chooses a motif and then is directed to a page with a link to their website with the new motif active. The problem is when i click on the link to view the site, it is blank(except for my response statement)or gives me a header error depending on the way that I called the new motif.<BR><BR>Below is the default.asp that calls the new motif. there are 2 versions in the if/then logic both of which give me errors. It has to be something simple... a fresh view would be greatly appreciated.<BR>-Sharon<BR><BR><BR>&#060;%<BR>Dim strConn<BR>Dim objConn<BR>Dim objRS<BR>Dim strSQL<BR><BR>strConn = "Driver={SQL Server};SERVER=;UID=ssadmin;PWD=ssad min1;DATABASE=SS_EN_NAED"<BR>Set objConn = server.createobject ("adodb.connection")<BR> strConn<BR><BR>&#039;For NAED SQL statement should read as follows<BR>&#039; strSQL = "Select motif from sites where clientid = " & SubMemID<BR>strSQL = "Select motif from sites where clientid=564"<BR>Set objRS = objConn.Execute (strSQL)<BR>Response.Write "Motif ID:" & objRS("motif")<BR><BR><BR>If objRS("motif") = "3" Then <BR> Response.Redirect ""<BR>Elseif objRS("motif") = "5" Then<BR> Response.Write "&#060;!--#include file=""""--&#062;"<BR>Else <BR> Response.Write "This line should never ever be called if errorhandling on acttemplate.asp is functioning."<BR>End If<BR>%&#062;<BR>-----------------------------------------------<BR>Response.Redirect version <BR>Error:<BR>"The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content." <BR>---------------------------------------------------<BR>Response.Write version<BR>View Source shows this as the code:<BR>Motif ID:3<BR> &#060;!--#inlcude file=""--&#062;<BR><BR>(the asp page isn&#039;t compiling the include file before writing to the browser, I guess)<BR><BR><BR>

  2. #2
    hjm Guest

    Default RE: calling an include file from the default.asp

    For the response.redirect you may want to make sure you haven&#039;t sent any info back to user before you use that statement. <BR><BR>You cannot response.write a include file. You will want to close the asp delimiters, type the include and then start the asp delimiters again. eg. Asp code %&#062; &#060;!--include--&#062; &#060;%back to asp code.<BR><BR>

Posting Permissions

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