dynamically set property on a control

P

Peter Kirk

Hi

say I have a literal on an ascx:
<asp:Literal id="myLabel" runat="server" Text="literal text" />

How do I change the text value to a "dynamic" value?

I would like to be able to do something like:
<asp:Literal id="myLabel" runat="server" Text="<%= myName %>" />

where myName is a string defined elsewhere. The only way I know of doing
this is by setting the text value in the code behind, but is it possible to
do it in the ascx?

thanks,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,099
Messages
2,570,626
Members
47,237
Latest member
David123

Latest Threads

Top