Passing some info to a control at runtime.

S

Simon Harvey

Hi all,

I've made a user control and I need to pass it some information so it knows
what it should display. Can anyone tell me what i need to do to pass it
information via html attributes. eg:

<asp:mycontrol myproperty="true" runat="server"></asp:mycontrol>

I know I can pass it information in my codebehind, but i need to do that
before the controls page load is called.

Many thanks to anyone who can help

Simon
 
S

Shiva

Hi,

Expose a property from your user control (that will receive the info) and
set the value for that property from the HTML markup (using attirubtes) like
how you have given below.

HTH

Hi all,

I've made a user control and I need to pass it some information so it knows
what it should display. Can anyone tell me what i need to do to pass it
information via html attributes. eg:

<asp:mycontrol myproperty="true" runat="server"></asp:mycontrol>

I know I can pass it information in my codebehind, but i need to do that
before the controls page load is called.

Many thanks to anyone who can help

Simon
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top