sitecorp
12-30-2005, 07:02 PM
Hi,
I have an aspx page http://www.fast-drinks.com/Categories.aspx - There are various categories eg Spirits, Wines, beer - but within each category there are sub categories eg for Spirits you have Gin, Vodka, Whiskey etc.
The Category is being displayed in the html via the variable <%=SuperCats%> (I'm presuming this is an ASP (or ASP.Net) variable - I'm new to this!). What I want to do is depending on this value to display a different image. If you go to the above page you will see a grey bar with no content about 2 inches down the page. I want to put one image in this bar if <%=SuperCats%> is Spirits and another if its Wine and another if its Champagene, and anther if its Gifts, and anotherif .........................
I am presuming a JavaScript if statement will do the job - I just don't know how to implement it as the page is being rendered, as I am relatively new to the whole web development side of things - I normally do console apps.
THis is the code black I have at the moment
<tr height="22" style="background-image:url(images/front_end_site_images/sort_bar.gif)">
<td colspan="2">
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
if (<%=SuperCats%>=="Gift Ideas")
{
document.write('<img src="images/front_end_site_images/giftideas.gif">');
}
else if (<%=SuperCats%>=="Champagnes")
{
document.write('<img src="images/front_end_site_images/champagne.gif">');
}
else
{
document.write("hi...test..nothing done");
}
</SCRIPT>
<td>
</tr>
Your help is appreciated in any way shape or form.
Thanks and Best Regards
I have an aspx page http://www.fast-drinks.com/Categories.aspx - There are various categories eg Spirits, Wines, beer - but within each category there are sub categories eg for Spirits you have Gin, Vodka, Whiskey etc.
The Category is being displayed in the html via the variable <%=SuperCats%> (I'm presuming this is an ASP (or ASP.Net) variable - I'm new to this!). What I want to do is depending on this value to display a different image. If you go to the above page you will see a grey bar with no content about 2 inches down the page. I want to put one image in this bar if <%=SuperCats%> is Spirits and another if its Wine and another if its Champagene, and anther if its Gifts, and anotherif .........................
I am presuming a JavaScript if statement will do the job - I just don't know how to implement it as the page is being rendered, as I am relatively new to the whole web development side of things - I normally do console apps.
THis is the code black I have at the moment
<tr height="22" style="background-image:url(images/front_end_site_images/sort_bar.gif)">
<td colspan="2">
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
if (<%=SuperCats%>=="Gift Ideas")
{
document.write('<img src="images/front_end_site_images/giftideas.gif">');
}
else if (<%=SuperCats%>=="Champagnes")
{
document.write('<img src="images/front_end_site_images/champagne.gif">');
}
else
{
document.write("hi...test..nothing done");
}
</SCRIPT>
<td>
</tr>
Your help is appreciated in any way shape or form.
Thanks and Best Regards