PDA

View Full Version : asp drop down menus - help


Climbing on board
12-09-2008, 12:24 PM
Hi,

I have been trying to figure out how someone else made these drop down menus using asp in Dreamweaver for a site I now have to maintain. I will say now I have no experience of asp or much coding at all, just trying to get into it. Been working through some tutorial but found nothing which helps.

Anyway I have a page with a side navigation that has 2 step levels of drop down menu's. I have figured out how it all works but not sure if this ("stands_graphics_tools") references to anything else and now I need to add an extra section and cannot get it to working. Do I need to add a script somewhere else?

This is the code:

<% If script_name = "stands_graphics_tools" Then %>
<tr>
<td colspan="2" align="left" valign="middle"><img src="/images/navspacer_01.gif" width="153" height="1" /></td>
</tr><td colspan="2" align="left" valign="middle" class="navCellOffA" onmouseover="this.className='navCellOn';" onmouseout="this.className='navCellOffA';"><% Else %><td colspan="2" align="left" valign="middle" class="navCellOff" onmouseover="this.className='navCellOn';" onmouseout="this.className='navCellOff';"><% End if %>
&nbsp;&nbsp;&nbsp;<a href="stands_graphics_tools.asp" class="navLink">Stands, Graphics &amp; Tools </a></td>
</tr>
<tr>
<td colspan="2" align="left" valign="middle"><img src="images/navspacer_02.gif" width="153" height="1" /></td>
</tr>

<% If script_name = "stands_graphics_tools" Then %>
<!--#include file="_sidebar_stands_graphics_tools.asp" -->
<% End if %>

Thank you in advance and sorry for my lack of experience. I am super willing to learn so if you think I should do learning first then try and solve this later please don't be shy to say.

mangofreak
12-14-2008, 01:26 AM
The ASP code is only been used to show the html conditionally.



<% If script_name = "stands_graphics_tools" Then %>
The above is saying: if the variable script_name is equal to "stands_graphics_tools" then, run the code below or show the code below.

<tr>
<td colspan="2" align="left" valign="middle"><img src="/images/navspacer_01.gif" width="153" height="1" /></td>
</tr><td colspan="2" align="left" valign="middle" class="navCellOffA" onmouseover="this.className='navCellOn';" onmouseout="this.className='navCellOffA';">


<% Else %>
The Esle above means: otherwise(if the variable script_name is not equal to "stands_graphics_tools" then, run the code below or show the code below.)
<td colspan="2" align="left" valign="middle" class="navCellOff" onmouseover="this.className='navCellOn';" onmouseout="this.className='navCellOff';">

<% End if %>
And finish here

&nbsp;&nbsp;&nbsp;<a href="stands_graphics_tools.asp" class="navLink">Stands, Graphics &amp; Tools </a></td>
</tr>
<tr>
<td colspan="2" align="left" valign="middle"><img src="images/navspacer_02.gif" width="153" height="1" /></td>
</tr>


<% If script_name = "stands_graphics_tools" Then %>
This is the same bit instead to run a code it conditionally asks to Include the file called "_sidebar_stands_graphics_tools.asp"

<!--#include file="_sidebar_stands_graphics_tools.asp" -->

<% End if %> This indicates the end if that condition.



Basically ASP is not creating the code here but displaying the apropriate code depending on conditions. Hope it helps.

Javier