Hi Imar:
Here is the user control banner code:
<%@ Control Language="
VB" AutoEventWireup="false" CodeFile="Banner.ascx.
vb" Inherits="Controls_Banner" %>
<asp:Panel ID="pnlVertical" runat="server">
<a href="http://p2p.wrox.com" target="_blank"> runat="server" id="lnkVertical">
<asp:Image ID="Image1" runat="server" AlternateText="This is a simple banner"
ImageUrl="~/Images/Banner120x240.gif" />
</a>
</asp:Panel>
<asp:Panel ID="pnlHorizontal" runat="server">
<a href="http://p2p.wrox.com" target="_blank"> runat="server" id="lnkHorizontal">
<asp:Image ID="Image2" runat="server" AlternateText="This is a simple banner"
ImageUrl="~/Images/Banner468X60.gif" />
</a>
</asp:Panel>
and the code behind:
Partial Class Controls_Banner
Inherits System.Web.UI.UserControl
Private _displayDirection As direction = direction.Vertical
Public Property DisplayDirection() As direction
Get
Return _displayDirection
End Get
Set(ByVal value As direction)
_displayDirection = value
End Set
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
pnlHorizontal.Visible = False
pnlVertical.Visible = False
Select Case DisplayDirection
Case direction.Horizontal
lnkHorizontal.Href = NavigateUrl
Case direction.Vertical
pnlVertical.Visible = True
lnkVertical.HRef = NavigateUrl
End Select
End Sub
End Class
I couldn't figure out what I did wrong.
Thanks for your help!
Jan