ASP.NET: Pass value from User Control to page?

后端 未结 3 1498
温柔的废话
温柔的废话 2021-01-13 13:34

I am creating a user control in ASP.NET (using VB) that uses the autocomplete ajax control on a textbox to get a value. Then I want the page to post back and run some code

3条回答
  •  滥情空心
    2021-01-13 13:58

    In the code-behind on your user-control expose a property e.g.

    public TextBox UserControlTextBox
    {
        return this.TextBoxInstance;
    }
    

    Then from you page just call

    UserControlInstance.UserControlTextBox.Text;
    

提交回复
热议问题