Jump to content

ASP help needed !


denny911

Recommended Posts

Hello.I know so little about ASP but I find it very useful and exciting. However, I started to learn it's basics just yesterday since I want to use it on my site.Now, I need your help. I want the text of my (css controlled) navigational links to be dynamically inserted by ASP, using <--#include file=" "--> piece of code. What I managed to do so far is to make individual .inc files for every button (text link) of my main navigation menu.But, I wonder if it's possible to have only one .inc file that would contain the text of the whole menu. For example, the file mainMenu.inc would then be included in appropriate places in page-menu's code, but only a part of the file would be displayed for each of the links.I've considered using the IF - THEN function but I don't know how to implement that (actually I don't even know if that is possible).I will appreciate any kind of help. Denis, Bosnia H.

Link to comment
Share on other sites

Using the Content Linkin Component1) Create the file nav.txt (or whatever you want to call it. Just remember the exact file name).2) In your nav.txt file, you need to format your text as such:

home.asp	(TAB) Homepage1.asp	(TAB) Example Page 1page2.asp	(TAB) Example Page 2contact.asp (TAB) Contact Us

In the above, the first column indicates the URL to the web page you are linking to. so for example, if you wanted your first link to go to your homepage, you would use this url:http://www.your-domain.com/index.aspAfter you have wrote the URL, you need to use the TAB spacing character. NOT the space bar.When you have pressed tab, enter the text you want users to click on. IE:index.asp (TAB) HomeSave this file to your server, and take note of the location.Next, open the file you want your links to be displayed on, and enter this code:

<%	dim c	dim i  set nl=server.createobject("MSWC.Nextlink")  c = nl.GetListCount("nav.txt")  i = 1%><table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" valign="top"><%	do while (i <=c) %>	<tr>  <td width="100%" align="left" valign="top">  <a href="<%=nl.GetNthURL("nav.txt", i)%>" target="_self"><%=nl.GetNthDescription("nav.txt", i)%></a>  </td>	</tr><%	i= (i+1)	loop%></table>

Save that page as a .asp page, save to your server and run the page.

Link to comment
Share on other sites

  • 3 months later...
Guest Darkphoenix

Okay, I got it to work, here is how:

<%dim cdim i set nl=server.createobject("MSWC.Nextlink") c = nl.GetListCount("nav.txt") i = 1%><table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" valign="top"><%do while (i <=c) %><tr> <td width="100%" align="left" valign="top"> <a href="[B]http://myip:myport/[/B]<%=nl.GetNthURL("nav.txt", i)%>" target="_self"><%=nl.GetNthDescription("nav.txt", i)%></a> </td></tr><%i= (i+1)loop%></table>

This way, you canlink to other services or, hosts.

Edited by Darkphoenix
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...