How to bind to a given property?

M

mehdi_mousavi

Hi,
Consider a user control, say, myctrl.ascx, that is supposed to display
a given string parameter. The parameter is defined as a property on the
control as follows:

public string HeaderText
{
get {return m_strHeaderText;}
set {m_strHeaderText = value;}
}

The question is that how am I supposed to bind this property into an
element of the page (within .aspx)? for exmaple, if I was using a
datalist, I knew I had to use the

<%#DataBinder.Eval(Container.DataItem, "HeaderText")%>

syntax to bind to the "HeaderText". However, I'm not using a datalist,
nor any predefined web controls. any idea?

Thank you for your time,
M.Mousavi
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top