Update Panel error: Control with the ID “xxx” could not be found in the UpdatePanel

后端 未结 5 1902
小蘑菇
小蘑菇 2021-01-13 12:05

I have a composite drop down calendar user control that consists of a textbox and and calendar image and a validation control. I expose a property called \"TextBox\" on the

5条回答
  •  半阙折子戏
    2021-01-13 12:38

    For an html control runat server inside of an update panel you need to dereference the update panel to get a handle to the control on the server side:

    using System.Web.UI.HtmlControls;

    HtmlControl x = (HtmlControl)this.MyUpdatePanel.FindControl("MyHtmlControl");
    

提交回复
热议问题