Or for plain old ASP you could use an iframe and load that up based on your listbox selection via Javascript.
Javascript and iframe would be along the lines of:
[HTML]<script language='JavaScript'>
function loadStuff(sArticleID){
//maybe add checks for valid article id formats... and produce nice messge for dodgy stuff --I've included the styles in the frame that you may wnat to change
window.ArticleLoader.location = 'artyldr.asp?ID='+sArticleID;
//Should put in some kinda check for timeouts (window.setTimeout(blah))
return 1;
}
</script>
<select onchange="loadStuff(this.options[this.selectedIndex].value)">
<option value=1>article one</option>
<option value=2>article two</option>
<option value=3>article three</option>
</select>
<iframe name="ArticleLoader" width=200 height=250 src="" style="visibility:visible"></iframe>[/HTML]
The article ID in the select option would refer directly to your db article key.
You would also need to have another asp page which loads your article based on the article id passed in the querystring (from Javascript)
artyldr.asp -
<%
-
dim strKey
-
-
strKey = Request.QueryString("id")
-
-
'querydb based on this id
-
-
'Display the ouput in whatever format you want as a whole page.
-
-
%>
Clearly you will need to add a bit of CSS magic to make things look nice etc...
right, im trying the iframe thing, but im getting abit stuck... can you have a look and see where im going wrong, i think its the part where im trying to pass the value of the listbox back to the javascript...::
<%@ Language=VBScript %>
<HTML>
<script language='JavaScript'>
function loadStuff(sArticleID){
//maybe add checks for valid article id formats... and produce nice messge for dodgy stuff --I've included the styles in the frame that you may wnat to change
window.ArticleLoader.location = 'artyldr.asp?ID='+sArticleID;
return 1;
}
</script>
<!--<SCRIPT language=VBscript>
Sub RunScript
Msgbox Listbox1.Value
End Sub
</SCRIPT>-->
<HEAD>
<link rel="stylesheet" type="text/css" href="RetroToons.css">
</HEAD>
<BODY>
<FORM id="Articles" name="Articles" method="post" action="Articles.asp">
<%
dim WhichSelected
WhichSelected = Request.Form("chosen")
%>
<DIV style="Margin-Left: 120px;">
<!--#include file ="SiteHeader.asp"-->
<!--#include file ="DynamicCSS.asp"-->
<!--#include file ="Menu.asp"-->
<DIV id=Middle>
<DIV id=Mainbody>
<%
dim objArticlesNode
set objArticlesDLL = createobject("ArticlesDLL.ArticlesClass")
dim GetArticlesResult
GetArticlesResult = objArticlesDLL.RetrieveArticles
set objDOM = server.CreateObject("MSXML2.DOMDocument")
objDOM.LoadXML(GetArticlesResult)
'Response.Write Server.HTMLEncode(objDom.xml)
'Response.End
%>
<BR>
<STRONG>
Please select the title of the article you wish to read...
</STRONG>
</BR>
<BR />
<select size="3" name="Listbox1" onchange="loadStuff(this.options[this.selectedIndex].value)" colspan="50">
<%
If objDOM.selectSingleNode("Response/RESULT").Text ="SUCCESS" then
for each objSearchNode in objDOM.selectNodes("Response/Article")
%>
<option value="<%Response.Write objSearchNode.selectsinglenode("Number").text%>">
<%Response.Write objSearchNode.selectsinglenode("Title").text%>
</option>
<%
next
end if%>
</select>
<HR width=50%>
<P />
<%Response.Write "***" & WhichSelected & "***"%>
<iframe name="ArticleLoader" width=700 height=500 src="" style="visibility:visible"></iframe>
<Table>
<tr>
<td><input type="hidden" name="chosen"></td>
</tr>
</Table>
</DIV>
<DIV id=right>
<!--#include file ="RightBody.asp"-->
<!--#include file ="RightLower.asp"-->
</DIV>
</DIV>
<BR />
<!--#include file ="Footer.asp"-->
</DIV>
</FORM>
</BODY>
</HTML>