Jump to content

How do I write a page so it reloads with new data


ahill

Recommended Posts

Hey guys new to ASP so my terminology may not be quite right. Looking to build a page that has a table that it pulls from SQL database. Every time you click on an image on the table i want the page to pull the variable and reload in the same page to a new variable. So it sort of drills down variables.

 

Currently my page pulls from my database and displays images the way it needs to. Now i need to be able to click on the image and have the page reload into the same page with the variable selected. My database is set up already.

post-185325-0-83582500-1433859109_thumb.png

Edited by ahill
Link to comment
Share on other sites

This is currently the code I have to display the table with images
SQL = "select type from resources group by type order by type"
RSb.Open SQL,Conn
Dim mytype,mr,mpic
mr = 1
If rsb.eof then
'response.write "NOT FOUND"
else
do until rsb.eof
mytype = trim(rsb("type"))
mpic = mytype & ".JPG"
If mr = 1 then
response.write "<tr>"
end if
Response.write "<td><img src=""images/"& mpic &""" />"
Response.write mpic & "</td>"
If mr = 3 then
mr = 0
response.write "</tr>"
end if
mr = mr + 1
rsb.movenext
loop
response.write "</table>"
end if
%>
Link to comment
Share on other sites

Hey guys new to ASP so my terminology may not be quite right. Looking to build a page that has a table that it pulls from SQL database. Every time you click on an image on the table i want the page to pull the variable and reload in the same page to a new variable. So it sort of drills down variables.

Currently my page pulls from my database and displays images the way it needs to. Now i need to be able to click on the image and have the page reload into the same page with the variable selected. My database is set up already.

this is currently the code I have to display the table with images
SQL = "select type from resources group by type order by type"
RSb.Open SQL,Conn
Dim mytype,mr,mpic
mr = 1
If rsb.eof then
'response.write "NOT FOUND"
else
do until rsb.eof
mytype = trim(rsb("type"))
mpic = mytype & ".JPG"
If mr = 1 then
response.write "<tr>"
end if
Response.write "<td><img src=""images/"& mpic &""" />"
Response.write mpic & "</td>"
If mr = 3 then
mr = 0
response.write "</tr>"
end if
mr = mr + 1
rsb.movenext
loop
response.write "</table>"
end if
%>

post-185325-0-98923200-1433862753_thumb.png

Link to comment
Share on other sites

You'll need to write your code in VBScript if that's what you're using with ASP, yes. Correct, you'll use if statements to check if the name is in the list of things you want to skip. There's a brief description here:http://www.w3schools.com/vbscript/vbscript_conditionals.aspIt looks like they only use the = operator in those examples, the other operators you can use are listed here:https://msdn.microsoft.com/en-us/library/9hck4s70(v=vs.84).aspx

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...