all groups > asp.net building controls > july 2004 >
You're in the

asp.net building controls

group:

Passing some info to a control at runtime.


Passing some info to a control at runtime. Simon Harvey
7/27/2004 4:13:08 PM
asp.net building controls:
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

Re: Passing some info to a control at runtime. Shiva
7/27/2004 9:12:37 PM
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

[quoted text, click to view]
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


AddThis Social Bookmark Button