Cannot pass properties to a UserControl in Button_Click event

J

Jenny

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top