Pass data from a ASP.NET page to ASCX user controls loaded dynamically

前端 未结 6 1912
鱼传尺愫
鱼传尺愫 2020-12-08 05:05

I\'m developing an ASP.NET application with C# and Ajax.

I have a page that holds user controls loaded dynamically. I need to pass some data (integer values and some

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 05:11

    Setup public properties within your user control.

    public string TestValue { get;set;};
    

    And then when you put your user control in your aspx page:

    
    

    You can also change the values within your code behind:

    uc1.testValue = "some value";
    

提交回复
热议问题