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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if statement for an ascx page

Status
Not open for further replies.

lagc

Programmer
Jan 21, 2009
79
GB
I have never come across a ascx page before, but I'm working on a site that was developed outside the company and I'm trying to re-skin it and change things around a bit.

I got an image that I want only to show on the login page and not elsewhere, so th eoanswer to this is to use an if statement, as below:

Code:
if (url="[URL unfurl="true"]http://localhost:81/Login.aspx")[/URL]
{
<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>
}
else
{
<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>
}

I'm suing Dreamweaver, and the if statement is not in colour, so that tells me its not right. Can somebody help me get that if statement working in an ascx page, and the if statement looking at anch checking the current url.

Cheers
 
ascx is no different than aspx. the ascx is a webusercontrol. My guess is your mixing serverside and client side code.

if you haven't worked with webforms before read up on how markup and codebehind work. you will also need to understand the difference between client and server code.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top