// When the control is in the Master
Literal lit = (Literal)Master.FindControl("Literal1");
lit.Text = DateTime.Now( );
// When the control is in a content page we have to use trace to locate the
control in the control hierarchy and use FindControl on each object.
Go to OdeToCode.com there are a series of excellent articles about
MasterPages.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL
http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
"Spondishy" <sp*******@tiscali.co.ukwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi,
I have a master page with a literal control. As an example, I'm trying
to set the text of the literal to the current time. In the code behind
for the master page I've got a method that returns the string for the
current time.
So I have this:
<asp:Literal ID="Literal1" runat="server"
Text="<%#GetTime()%>"></asp:Literal>
Unfortunately, this doesn't appear to work in a master page. Any way of
doing this?