Passing some info to a control at runtime.

Discussion in 'ASP .Net Building Controls' started by Simon Harvey, Jul 27, 2004.

  1. Simon Harvey

    Simon Harvey Guest

    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
     
    Simon Harvey, Jul 27, 2004
    #1
    1. Advertising

  2. Simon Harvey

    Shiva Guest

    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

    "Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
    news:egyv20#...
    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
     
    Shiva, Jul 27, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasanth
    Replies:
    0
    Views:
    566
    Vasanth
    Jun 28, 2004
  2. Simon Harvey

    Passing some info to a control at runtime.

    Simon Harvey, Jul 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    293
    Shiva
    Jul 27, 2004
  3. Andrea Williams

    Clear the Render info & change to different info

    Andrea Williams, Oct 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,428
    Ken Dopierala Jr.
    Oct 27, 2004
  4. Kiran
    Replies:
    0
    Views:
    1,232
    Kiran
    Feb 6, 2005
  5. Simon Harvey

    Passing some info to a control at runtime.

    Simon Harvey, Jul 27, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    117
    Shiva
    Jul 27, 2004
Loading...

Share This Page