From a Panel how to pass values into User Control

R

ree32

Inorder to react to events I have added a usercontrol onto a Panel on my main page.

The problem is the user control takes inputs to initalise itself.

In the common method of adding a usercontrol into a page.
I would write this ..
<uc1:menu id="Menu" runat="server" InputText="categories"></uc13:menu>

As you can see I need to pass in the value of "InputText".

But using a panel to add the control I am not sure how to pass InputText.

This is the code I have so far ..

ASPX file -
<asp:panel id="mainPanel" runat="Server"></asp:panel>

VB file-

Dim menuControl As Control = LoadControl("menu.ascx")
AddHandler CType(menuControl , menu).EventOccured, AddressOf Me.FunctionToReact
mainPanel.Controls.Add(menuControl)

Not sure how to add "InputText".
 
R

ree32

I dont know if you guys didn't know the answer or didn't understand the question.

But I found the solution.


CType(uc1Control, uc1).PropertyName = "stringName"
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top