ASP.NET: pass value from user control to page?

I am creating a user control in ASP.NET (using VB) that uses autocomplete ajax control in a text box to get the value. Then I want the page to send back and run some code according to any value passed to it from this control. The problem is that I'm not quite sure how to do this. I am sure it is easy, and I should know, but I do not.

Thanks in advance!

+5
source share
3 answers

In your user control, set the property to value

Public Property SomeValue() As String
Get
    Return textbox1.Text
End Get
End Property

aspx .

userControl1.SomeValue

, vb.net, vb, .

+11

((NameOfPage) this.Page).VariableOnPage = this.Foobar;

0

, .

public TextBox UserControlTextBox
{
    return this.TextBoxInstance;
}

UserControlInstance.UserControlTextBox.Text;
0

All Articles