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. Advertising

  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. 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. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,144
    Matt Morris
    Jan 23, 2004
  2. Replies:
    0
    Views:
    4,444
  3. Chris
    Replies:
    1
    Views:
    668
    Chris
    May 11, 2006
  4. 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:
    122
    John Saunders
    Jun 5, 2004
  5. Chris

    how to pass a variable from test.aspx.vb to test.aspx

    Chris, May 11, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    4
    Views:
    574
Loading...

Share This Page