pass value to user control from aspx

Discussion in 'ASP .Net' started by pei_world, Jan 5, 2005.

  1. pei_world

    pei_world Guest

    I have a user control:

    - using LoadControl("MyCtrl.ascx")
    MyCtrl _mycontrol = (MyCtrl)LoadControl("MyCtrl.ascx")
    Page.Controls.Add(_mycontrol);
    _mycontrol.Text

    it will be loaded when some events fired.
    so how can I pass value to this user control from aspx template file.
     
    pei_world, Jan 5, 2005
    #1
    1. Advertisements

  2. Hi,

    Create a property in user control and set the property in template file or
    code file.

    Prakash.C

    "pei_world" wrote:

    > I have a user control:
    >
    > - using LoadControl("MyCtrl.ascx")
    > MyCtrl _mycontrol = (MyCtrl)LoadControl("MyCtrl.ascx")
    > Page.Controls.Add(_mycontrol);
    > _mycontrol.Text
    >
    > it will be loaded when some events fired.
    > so how can I pass value to this user control from aspx template file.
    >
    >
    >
     
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=, Jan 5, 2005
    #2
    1. Advertisements

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. Hermit Dave

    pass value of a variable to user control

    Hermit Dave, Dec 12, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    5,749
    Rocky Moore
    Dec 13, 2003
  2. Replies:
    0
    Views:
    4,625
  3. pei_world

    how to pass value to my user control

    pei_world, Jan 4, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    526
    John Saunders
    Jan 5, 2005
  4. Mad Scientist Jr
    Replies:
    0
    Views:
    892
    Mad Scientist Jr
    Mar 22, 2006
  5. rose
    Replies:
    2
    Views:
    2,340
    Michael Nemtsev [MVP]
    Mar 25, 2008
  6. Ken Fine
    Replies:
    4
    Views:
    3,230
    SteveT
    Dec 19, 2008
  7. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    806
    Jonathan Wood
    Feb 2, 2010
  8. Sathyadeva Aithal via .NET 247

    How to pass variables from aspx page to user control

    Sathyadeva Aithal via .NET 247, Jun 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    183
    John Saunders
    Jun 5, 2004
Loading...