Click to See Complete Forum and Search --> : best way to display content


jrthor2
08-02-2007, 12:34 PM
I have 1 page that I want to display a persons biography information based on who the user clicks on from the previous page. Right now, I have an id assigned to each link, which tells the bio page which data to show. The data I have is not stored in any database or anything. I have the data in the page, and then a switch statement based on the id to show the correct data. My question, is there a better way to do this? The code will be very long with 17+ bio's. Below is the code I have so far, just for one person, but will grow.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
Dim id
Dim image
Dim text
Dim mgrName

id = Request.QueryString("id")


Select Case id
Case 1
image = "Fname_Lname.jpg"
mgrName = "Fname Lname"
text = "<p>The persons bio here</p><p>More bio information</p>"
Case 2
image = ""
mgrName = ""
text = ""
Case 3
image = ""
mgrName = ""
text = ""
Case 4
image = ""
mgrName = ""
text = ""
Case 5
image = ""
mgrName = ""
text = ""
Case 6
image = ""
mgrName = ""
text = ""
Case 7
image = ""
mgrName = ""
text = ""
Case 8
image = ""
mgrName = ""
text = ""
Case 9
image = ""
mgrName = ""
text = ""
Case 10
image = ""
mgrName = ""
text = ""
Case 11
image = ""
mgrName = ""
text = ""
Case 12
image = ""
mgrName = ""
text = ""
Case 13
image = ""
mgrName = ""
text = ""
Case 14
image = ""
mgrName = ""
text = ""
Case 15
image = ""
mgrName = ""
text = ""
Case 16
image = ""
mgrName = ""
text = ""
Case 17
image = ""
mgrName = ""
text = ""
Case Else

End Select
%>
<html>
<head>
<title>Distribution Centers</title>
<link media="screen" title="main" rel="stylesheet" type="text/css" href="/distdocs/css/main.css" />
</head>
<body>
<div id="wrapper">
<div class="leftCol">
<img src="images/mgrs/<%=image%>" alt="bio" width="250" height="188" />
<p class="mgrName">
<%=mgrName%>
</p>
</div>
<div class="rightCol">
<%=text%>
</div>
</div>
</body>
</html>


Thanks

nbcrockett
08-02-2007, 01:03 PM
I would put all your variables (image, mgrname, text) in a database. Then call the appropriate record from the database using your id.

jrthor2
08-02-2007, 01:06 PM
I agree with you, but the business partner doesn't want it in a database.

nbcrockett
08-02-2007, 01:07 PM
Another thought! You could use the same database to display your available bios on the first page.

nbcrockett
08-02-2007, 01:09 PM
Sorry posted back to quickly. Your current configuration is probably best if you don't want to use a db.

lmf232s
08-02-2007, 06:00 PM
Well I dont know if its a database that your partner does not want to use or what but you could also use an excel file or even a text file so that you dont have to hardcode the values in your code.