Messing around with asp

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
I'm just having a mess around with asp for no particular reason other than I've never done it before. I am working with this guy that uses it but there's no reason why I need to use it, I just want to know how.

Anyway I wonder can someone tell me first off why this page looks all right in IE but displays code in Firefox?
 

SheepCow

Bringer of Code
Joined
Dec 22, 2003
Messages
1,365
For starters that ASP hasn't been executed as it's visible in the source sent to the browser. The only diff between FX and IE is that IE knows it's ASP (or more likely doesn't know what it is at all and hides it) whereas FX doesn't know what it is and displays it raw.
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
Oh, is it because the server doesn't support asp perhaps?
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
Okay this guy's set up a dummy site for me but I can't seem to alter any of the files via FTP. He says he's tested it from his end and it works fine, all I get are 404s and 403s on all the files. Anyone have any ideas why this might be, it's all a mystery to me?
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
I got a windows server working now. I have the little site that someone set up for me to mess around with but I'm still totally lost with asp. There's no index file for one. The closest thing is a default.asp, I'm guessing that is the asp equivialant?

The damn things all in frames though. I'd like to get rid of the frames and make it just divs, or even tables would be better. Can someone show me, if it's possible, how I could change the following code to get rid of the frames and still display the same data. Or tell me if I'm thinking about it all wrong?

Code:
<%
'Maljonic test site'
%>
<!-- #include file="Functions/ResolveCustomer.asp" -->
<%
IF len(Session("CustomerID")) = 0 THEN
	SET Conn = Server.CreateObject("ADODB.Connection")
	Conn.Open Application("ConnectionString")
	strSQL = "exec sp_DetectNewInstallation"
	SET RecordSet =Conn.Execute(strSQL)
	
	DataExists = RecordSet("DataExists")
	
	SET RecordSet = nothing
	Conn.Close
	SET Conn=nothing

	IF DataExists = 0 THEN
		Response.Redirect ("Registration/default.asp")
	ELSE
		%>
		<script language="javascript">
			self.top.location.href="Functions/InvalidAccess.asp"
		</script>
		<%
		Response.End
	END IF
END IF
	
IF Request.QueryString("ID") <> "" THEN
%>
<frameset  rows="*,*" cols="*" frameSpacing="0" frameBorder="NO" border="0">
	<frame name="MyLocality" marginWidth="0" marginHeight="0" src="TextEditor/Page.asp?ID=<%=Request.QueryString("ID")%>">
<frame src="UntitledFrame-4"></frameset><noframes></noframes>
<%
	Response.End
END IF

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Application("ConnectionString")
%>
<html>


<%IF Session("DomainType") = 1 AND Session("TypeReference") <> "" THEN%>
  <head>
    <title><%
    strSQL = "exec sp_WebDocGetDetails '" & Session("CustomerID") & "','" & Session("TypeReference") & "'"
	SET RecordSet = Conn.Execute(strSQL)
    
    IF NOT RecordSet.EOF THEN
		IF RTRIM(LEN(RecordSet("DocumentTitle"))) > 0 THEN
			Response.Write RecordSet("DocumentTitle")
		END IF
	END IF
	%></title>
	<META name="description" content="<%
    IF NOT RecordSet.EOF THEN
		IF RTRIM(LEN(RecordSet("DocumentDescription"))) > 0 THEN
			Response.Write RecordSet("DocumentDescription")
		END IF
	END IF
	%>">
	<META name="keywords" content="<%
    IF NOT RecordSet.EOF THEN
		IF RTRIM(LEN(RecordSet("DocumentKeywords"))) > 0 THEN
			Response.Write RecordSet("DocumentKeywords")
		END IF
	END IF
	%>">
	<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://<%=Request.ServerVariables("SERVER_NAME")%>/rssreed.asp">
	
	<META name="robots" content="ALL" />
	<META name="revisit-after" content="1 days" />
	<META name="document-type" content="Public" />
	<META name="document-rating" content="General" />
	<META name="document-distribution" content="Global" />
	<META name="document-state" content="Dynamic" />
	
	<script language="javascript">
	<!--
	window.onload=doLoad;
	function doLoad(){
		if(self!=top){
			parent.location.href=self.location.href;
		}
	}
	//-->
	</script>
	
  </head>
  <frameset border="0" frameSpacing="0" rows="*" frameBorder="NO">
		<frame name="Main" marginWidth="0" marginHeight="0" src="TextEditor/DisplayDocument.asp?IgnoreBanner=1&DocumentID=<%=Session("TypeReference")%>">
  </frameset>
<%ELSE%>

  <head>
    <title><%
    strSQL = "exec sp_SearchEngineDescriptionGet '" & Session("CustomerID") & "'"
	SET RecordSet = Conn.Execute(strSQL)
    
    IF NOT RecordSet.EOF THEN
		IF RTRIM(LEN(RecordSet("SiteTitle"))) > 0 THEN
			Response.Write RecordSet("SiteTitle")
		END IF
	END IF
	%></title>
	<META name="description" content="<%
    IF NOT RecordSet.EOF THEN
		IF RTRIM(LEN(RecordSet("SiteDescription"))) > 0 THEN
			Response.Write RecordSet("SiteDescription")
		END IF
	END IF
	%>">
	<META name="keywords" content="<%
    IF NOT RecordSet.EOF THEN
		IF RTRIM(LEN(RecordSet("SiteKeywords"))) > 0 THEN
			Response.Write RecordSet("SiteKeywords")
		END IF
	END IF
	%>">
	<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://<%=Request.ServerVariables("SERVER_NAME")%>/rssreed.asp">
	
	<META name="robots" content="ALL" />
	<META name="revisit-after" content="1 days" />
	<META name="document-type" content="Public" />
	<META name="document-rating" content="General" />
	<META name="document-distribution" content="Global" />
	<META name="document-state" content="Dynamic" />
	<script language="javascript">
	<!--
	window.onload=doLoad;
	function doLoad(){
		if(self!=top){
			parent.location.href=self.location.href;
		}
	}
	//-->
	</script>
	
  </head>
	<%
	strSQL = "sp_AdvertSettingsGet '" & Session("CustomerID") & "'"
	SET RecSet = Conn.Execute(strSQL)
	%>

	<%IF RecSet("AdvertScrollBanner") = TRUE AND RecSet("AdvertsAvailable") = TRUE THEN%>
		<frameset border="0" frameSpacing="0" rows="80,*" frameBorder="NO">
			<frameset border="0" frameSpacing="0" cols="170,*" frameBorder="NO">
				<frame name="LeftTopCorner" marginWidth="0" marginHeight="0" src="CornerLogoPage.asp" scrolling="NO" noresize>
    			<frame name="TopMenu" marginWidth="0" marginHeight="0" src="MenuTop.asp" scrolling="NO" noresize>
			</frameset>
			<frameset border="0" frameSpacing="0" cols="170,*" frameBorder="NO">
				<frame name="LeftMenu" marginWidth="0" marginHeight="0" src="MenuLeft.asp" scrolling="NO" noresize>
				<frameset border="0" frameSpacing="0" rows="15,*" frameBorder="NO">
					<frame name="Advert" marginWidth="0" marginHeight="0" src="Advert.asp" scrolling="NO" noresize>
    				<%IF Request.QueryString("Type") <> "" THEN%>
    					<frame name="Main" marginWidth="0" marginHeight="0" src="Logon.asp?Type=<%=Request.QueryString("Type")%>&External=1" scrolling="AUTO" noresize>
    				<%ELSE%>
    					<%IF Request.QueryString("DocumentID") <> "" THEN%>
    						<frame name="Main" marginWidth="0" marginHeight="0" src="TextEditor/DisplayDocument.asp?DocumentID=<%=Request.QueryString("DocumentID")%>" scrolling="AUTO" noresize>
						<%ELSE%>
							<frame name="Main" marginWidth="0" marginHeight="0" src="TextEditor/DisplayHomePageExternal.asp" scrolling="AUTO" noresize>
						<%END IF%>
					<%END IF%>
				</frameset>
			</frameset>   
		</frameset>
	<%ELSE%>
		<frameset border="0" frameSpacing="0" rows="80,*" frameBorder="NO">
			<frameset border="0" frameSpacing="0" cols="170,*" frameBorder="NO">
				<frame name="LeftTopCorner" marginWidth="0" marginHeight="0" src="CornerLogoPage.asp" scrolling="NO" noresize>
    			<frame name="TopMenu" marginWidth="0" marginHeight="0" src="MenuTop.asp" scrolling="NO" noresize>
			</frameset>
			<frameset border="0" frameSpacing="0" cols="170,*" frameBorder="NO">
				<frame name="LeftMenu" marginWidth="0" marginHeight="0" src="MenuLeft.asp" scrolling="NO" noresize>
    			<%IF Request.QueryString("Type") <> "" THEN%>
    				<frame name="Main" marginWidth="0" marginHeight="0" src="Logon.asp?Type=<%=Request.QueryString("Type")%>&External=1" scrolling="AUTO" noresize>
    			<%ELSE%>
    				<%IF Request.QueryString("DocumentID") <> "" THEN%>
    					<frame name="Main" marginWidth="0" marginHeight="0" src="TextEditor/DisplayDocument.asp?DocumentID=<%=Request.QueryString("DocumentID")%>" scrolling="AUTO" noresize>
					<%ELSE%>
						<frame name="Main" marginWidth="0" marginHeight="0" src="TextEditor/DisplayHomePageExternal.asp" scrolling="AUTO" noresize>
					<%END IF%>
				<%END IF%>		
			</frameset>
		</frameset>
	<%END IF%>
<%END IF%>  
  
  
<%
SET RecordSet=Nothing
Conn.Close
Set Conn = Nothing
%>
 

SheepCow

Bringer of Code
Joined
Dec 22, 2003
Messages
1,365
The frames is an HTML issues, design your page then put the code in. Or design your page then find the relevant bits of ASP that get the data you want and copy/paste them in.
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
That's what I thought, it's just the bits in the frames like
Code:
src="TextEditor/Page.asp?ID=<%=Request.QueryString("ID")%>">
that confuse me a bit. How do I word that to put it in an asp page?

Something like:
Code:
<div><!-- #include file="TextEditor/Page.asp?ID=<%=Request.QueryString("ID")%>" --></div>
?
 

SheepCow

Bringer of Code
Joined
Dec 22, 2003
Messages
1,365
You wouldn't need to do that, just
Code:
<div><!-- #include file="TextEditor/Page.asp" --></div>

I don't think you can pass query strings on server side includes anyway. Request.QueryString gets things from the query string (bit after the ? in the URL), so all that is doing is passing on the ID part of the query from the framesetting page to the frame page. If you include the frame page it's like copy and pasting the code into the same document, so as the framesetting has the ID value, the included file will be able to see it too
 

Maljonic

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,297
Thanks, I'll give it a try - I sort of have the right idea. :)
 

Users who are viewing this thread

Top Bottom