Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

an if statement is a ascx page

Status
Not open for further replies.

lagc

Programmer
Jan 21, 2009
79
GB
I have an image issue in an ascx page, its not really anything to do with code itself, as what I need to control is the html part of it.
Basically I have an image tucked away in a table and what I need to do is check the url, if the url is displaying what I need it displays the image, if not i replicate the code and not display any image.

Here is the piece of very basic code below:

Code:
<td valign="middle" align="center" style="width: 239px; height: 80px;">
<asp:Image ID="ImageHeaderECristalLogo" ImageAlign="Top" Height="80px" Width="239px" runat="server" ImageUrl="~/Images/eCristalLogo_Large.gif" />
</td>

What I need to know is how to create that if statement surrounding that block of code with an else statement too.

Cheers
 
You may get more help in the ASP.Net forum -
In terms of your code you want something like :

if URL == X then
show image
else
show something else
end

Google provides a lot of information on how to get the current URL on the server side, using ASP.Net or the client side using Javascript or similar to achieve the same thing.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Hi,
Cheers, what I was looking for was the code to use. I havent come across pages as ascx before, so didnt know what language to use to get the if statement working.

I will look into using asp.net now.

Cheers
 
Im using Dreamweaver, and its very useful as it colour codes for you, as you will know.

But when i start writing the if statement it doesnt colour code, its black as though its not recognised.

I will try on the asp.net page, and see.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top