类型“System.Web.UI.UpdatePanel”不具有名为“DropDownList”的公共属性,解决方法

类型“system.web.ui.updatepanel” 不具有名为“***”的公共属性,
其实原因很简单。就是少了一个<ContentTemplate></ContentTemplate>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">


<asp:DropDownList ID="ddlUsed" runat="server">
                    <asp:ListItem Text="百度" Value="-1"></asp:ListItem>
                    <asp:ListItem Text="谷歌" Value="0"></asp:ListItem>
                    <asp:ListItem Text="新浪" Value="1"></asp:ListItem>
                </asp:DropDownList>

</asp:UpdatePanel>


正确的如下:

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
              asp:DropDownList ID="ddlUsed" runat="server">
                    <asp:ListItem Text="百度" Value="-1"></asp:ListItem>
                    <asp:ListItem Text="谷歌" Value="0"></asp:ListItem>
                    <asp:ListItem Text="新浪" Value="1"></asp:ListItem>
                </asp:DropDownList>      

           </ContentTemplate>    

  </asp:UpdatePanel>

原文地址:https://www.cnblogs.com/wifi/p/2232546.html