K
Kent P. Iler
Hi,
I created a user control to contain all my navigation items for the website.
I have a title in the nav bar that I set with an attribute in the tag
structure in the ASPX file where I'm using the control. Here's snippets
from the aspx file:
<%@ Register TagPrefix="uc1" TagName="left_nav" Src="left_nav.ascx" %>
Here's where I specify the label text (the PageLabel attribute):
<uc1:left_nav id="Left_nav1" runat="server" PageLabel="Send
e-Mail"></uc1:left_nav>
Inside the user control's ASCX page, I have this for displaying the label:
<asp:Label id="lblPageLabel" runat="server"></asp:Label>
Then, in the codebehind part of the user control, I have this:
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
If (PageLabel <> String.Empty) Then
Me.lblPageLabel.Text = MyPageLabel
End If
End Sub
There is are property routines for PageLabel that sets MyPageLabel =
PageLabel.
Is there a way I can have my ASPX page that includes this user control
overwrite the PageLabel attribute? On certain pages, I'll display something
based on passed-in values or values from a database.
Thanks.
-- Kent Iler
I created a user control to contain all my navigation items for the website.
I have a title in the nav bar that I set with an attribute in the tag
structure in the ASPX file where I'm using the control. Here's snippets
from the aspx file:
<%@ Register TagPrefix="uc1" TagName="left_nav" Src="left_nav.ascx" %>
Here's where I specify the label text (the PageLabel attribute):
<uc1:left_nav id="Left_nav1" runat="server" PageLabel="Send
e-Mail"></uc1:left_nav>
Inside the user control's ASCX page, I have this for displaying the label:
<asp:Label id="lblPageLabel" runat="server"></asp:Label>
Then, in the codebehind part of the user control, I have this:
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
If (PageLabel <> String.Empty) Then
Me.lblPageLabel.Text = MyPageLabel
End If
End Sub
There is are property routines for PageLabel that sets MyPageLabel =
PageLabel.
Is there a way I can have my ASPX page that includes this user control
overwrite the PageLabel attribute? On certain pages, I'll display something
based on passed-in values or values from a database.
Thanks.
-- Kent Iler