"moondaddy" <mo*******@nospam.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
I have a page which has a user control called CheckOutStatusBar and it
lives in a table call like this:
<%@ Register TagPrefix="uc1" TagName="CheckoutStatusBar"
Src="Navigation/CheckoutStatusBar.ascx" %>
html.....
<td>
<uc1:checkoutstatusbar id="CheckoutStatusBar1"
runat="server"></uc1:checkoutstatusbar>
</td>
I need to change the formating of a link button in CheckoutStatusBar.ascx
from its parent page. How an I get a reference to it from the parent
page?
It's best if you treat user controls like class instances (which they are).
This means that a user control shouldn't be exposing its link buttons to
the outside world. Instead, the user control should expose a method or
property which allows the link button formatting to change. For instance, in
the user control:
private bool _linkUnderlined = true;
public bool LinkUnderlined
{
get {return _linkUnderlined;}
set
{
_linkUnderlined = value;
if (_linkUnderlined)
{
lnkLinkButton.Styles["text-decoration"] = "underlined";
}
else
{
lnkLinkButton.Styles["text-decoration"] = "none";
}
}
}
--
John Saunders
johnwsaundersiii at hotmail