Inhalt in zweites Div ausgeben

schutzgeist

Erfahrenes Mitglied
Hallo zusammen.

Ich hab eine Seite mit 2 Layern, der eine dient als Navigation, der andere soll den Inhalt darstellen, welcher aus einer Datenbank gelesen werden soll.
Hab jetzt folgendes:

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connection.asp" -->
<%
Dim Startseite__MMColParam
Startseite__MMColParam = "1"
If (Request.QueryString("Startseite") <> "") Then 
  Startseite__MMColParam = Request.QueryString("Startseite")
End If
%>
<%
Dim Startseite
Dim Startseite_numRows

Set Startseite = Server.CreateObject("ADODB.Recordset")
Startseite.ActiveConnection = MM_connection_STRING
Startseite.Source = "SELECT * FROM Content WHERE Rubrik = '" + Replace(Startseite__MMColParam, "'", "''") + "'"
Startseite.CursorType = 0
Startseite.CursorLocation = 2
Startseite.LockType = 1
Startseite.Open()

Startseite_numRows = 0
%>
<%
Dim Satzung__MMColParam
Satzung__MMColParam = "1"
If (Request.QueryString("Satzung") <> "") Then 
  Satzung__MMColParam = Request.QueryString("Satzung")
End If
%>
<%
Dim Satzung
Dim Satzung_numRows

Set Satzung = Server.CreateObject("ADODB.Recordset")
Satzung.ActiveConnection = MM_connection_STRING
Satzung.Source = "SELECT * FROM Content WHERE Rubrik = '" + Replace(Satzung__MMColParam, "'", "''") + "'"
Satzung.CursorType = 0
Satzung.CursorLocation = 2
Satzung.LockType = 1
Satzung.Open()

Satzung_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Unbenanntes Dokument</title>
</head>

<body>

<div id="Layer1" style="position:absolute; left:0; top:0; width:800px; height:90px; z-index:1"></div>
<div id="Navi" style="position:absolute; left:0; top:90px; width:175px; height:962px; z-index:2; background-color: #66CCFF; layer-background-color: #66CCFF; border: 1px none #000000;">
  <p><a href="index.asp?Rubrik=Startseite">Startseite</a></p>
  <p>Aktuelles</p>
  <p><a href="index.asp?Rubrik=Satzung">Satzung</a></p>
</div>
<div id="Inhalt" style="position:absolute; left:175px; top:90px; width:625px; height:962px; z-index:3; background-color: #99FFCC; layer-background-color: #99FFCC; border: 1px none #000000;">
  <% If Not Startseite.EOF Or Not Startseite.BOF Then %>
  <%=(Startseite.Fields.Item("Inhalt").Value)%>
  <% End If ' end Not Startseite.EOF Or NOT Startseite.BOF %>
  <% If Not Satzung.EOF Or Not Satzung.BOF Then %>
  <%=(Satzung.Fields.Item("Inhalt").Value)%>
  <% End If ' end Not Satzung.EOF Or NOT Satzung.BOF %>
</div>
</body>
</html>
<%
Startseite.Close()
Set Startseite = Nothing
%>
<%
Satzung.Close()
Set Satzung = Nothing
%>

Nur leider bleibt mein Inhaltslayer leer :(
Ist die Abfrage flasch? Oder der Link?
Oder muss ich an der Stelle wo der Inhalt angezeigt werden soll noch was einbauen?

Danke schonmal,
schutzgeist
 
Hi

warum 2 Recordsets?
Eines reicht.

Ganz egal, welcher Parameter übergeben wird, darauf wird dieses eine Recordset gefiltert.

Der eigentliche Fehler aber liegt hier
If (Request.QueryString("Satzung") <> "") Then

Dein Parameter-Name heißt "Rubrik" und nicht Satzung oder Startseite.
Satzung und Startseite sind die Parameter-Werte, die übergeben werden.

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connection.asp" -->
<%
Dim Satzung__MMColParam
Satzung__MMColParam = "1"
If (Request.QueryString("Rubrik") <> "") Then 
  Satzung__MMColParam = Request.QueryString("Rubrik")
End If
%>
<%
Dim Satzung
Dim Satzung_numRows

Set Satzung = Server.CreateObject("ADODB.Recordset")
Satzung.ActiveConnection = MM_connection_STRING
Satzung.Source = "SELECT * FROM Content WHERE Rubrik = '" + Replace(Satzung__MMColParam, "'", "''") + "'"
Satzung.CursorType = 0
Satzung.CursorLocation = 2
Satzung.LockType = 1
Satzung.Open()

Satzung_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Unbenanntes Dokument</title>
</head>

<body>

<div id="Layer1" style="position:absolute; left:0; top:0; width:800px; height:90px; z-index:1"></div>
<div id="Navi" style="position:absolute; left:0; top:90px; width:175px; height:962px; z-index:2; background-color: #66CCFF; layer-background-color: #66CCFF; border: 1px none #000000;">
  <p><a href="index.asp?Rubrik=Startseite">Startseite</a></p>
  <p>Aktuelles</p>
  <p><a href="index.asp?Rubrik=Satzung">Satzung</a></p>
</div>
<div id="Inhalt" style="position:absolute; left:175px; top:90px; width:625px; height:962px; z-index:3; background-color: #99FFCC; layer-background-color: #99FFCC; border: 1px none #000000;">
  
  <% If Not Satzung.EOF Or Not Satzung.BOF Then %>
  <%=(Satzung.Fields.Item("Inhalt").Value)%>
  <% End If ' end Not Satzung.EOF Or NOT Satzung.BOF %>
</div>
</body>
</html>
<%
Satzung.Close()
Set Satzung = Nothing
%>
 
Zurück