ASP please help
- Started
- Last post
- 11 Responses
- mg33
Looking for an example of loading external ASP pages into a div within a master ASP page.
This would be for a list of news stories, and each title is a link that loads the external page into the same master page.
Since I've got my layout with XHTML and CSS, and pages are ASP to take advantage of additional features, I want to simply load ASP pages that are just text with formatting tags into a div to cut down on creating a new ASP/XHTML page for every new article.
Hope that makes sense. My brain is fried today.
- cosmo0
can u use includes in asp? if so just call the include in the div.
- mg330
Yes, you can use includes.
I'm doing so now with external files, but they load when the page loads.
I want to use an include based on a link being clicked.
Link 1
Link 2
Link 3
Link 4
Link 5Clicking any would call the external file and replace the list of links.
- cosmo0
hmmm...when a link is clicked u could use a case statement to select the appropriate include that u need for the div.
not sure if that helped?
- mg330
That's kind of what I'm thinking. I have this 700 pgae ASP book next to me and sometimes it's hard to figure out where to look.
My hunch says there's a way of doing an on.click unload current file, and include new file within the same div.
- cosmo0
umm...the case statement method should work, i use that method in php.
select
case 1: include (filename)
case 2: include (filename2)end select.
- mg330
We're getting there... :)
How can the include be inserted into a link?
- cosmo0
u don't have to insert the includes in the link.
link1: www.bah.com/index.asp?variable=1…
link 2: www.bah.com/index.asp?variable=2…
select variable
case 1:
include (filename)
case 2:
include (filename2)end select
- cosmo0
did u get it to work?
- mg330
I gave up and ate an enormous handful of chocolate covered espresso beans.
- cosmo0
i like the way u think. send me some of those chocolate beans.
- fugged0
you could try using the XMLHTTPRequest object.
Pass the URL to a javascript function that makes an XMLHHTPRequest to an ASP page with the URL as a query string. Then have that ASP page redirect to the URL. That should (?) return the HTML for the page, then just set the DIV's innerHTML to the response.
I dunno. Might work... Then again, maybe not.