Cannot pass properties to a UserControl in Button_Click event

Discussion in 'ASP .Net Web Controls' started by Jenny, Aug 13, 2003.

  1. Jenny

    Jenny Guest

    In test.aspx page, I have:
    <%@ Reference Control="./user_control/e_multi_choice.ascx" %>

    In test.aspx.vb page, I have:

    Dim mcFab As e_multi_choice =
    CType(LoadControl("./user_control/e_multi_choice.ascx"), e_multi_choice)

    CType(mcFab, e_multi_choice).Table = "Table1"

    CType(mcFab, e_multi_choice).Caption = "Table 1 Title"

    If I put this piece of code in Page_load event, it works fine. However,
    if I put it under a Button_Click event, the property value doesn't get
    passed.

    Please advise. Thank you very much.

    Jenny


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Jenny, Aug 13, 2003
    #1
    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. Tim Thomas
    Replies:
    3
    Views:
    839
  2. Tim T
    Replies:
    7
    Views:
    544
    Adam Carden
    Nov 1, 2003
  3. Tim Zych
    Replies:
    0
    Views:
    511
    Tim Zych
    May 15, 2004
  4. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: Dropdown list is getting cleared after button_click event

    Phil Winstanley [Microsoft MVP ASP.NET], May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    519
    Tim Zych
    May 16, 2004
  5. Skating_vince
    Replies:
    2
    Views:
    424
    Skating_vince
    Aug 13, 2004
Loading...

Share This Page