簡體   English   中英

'System.Web.UI.WebControls.ImageButton'沒有名為'UpdateProgress'的公共屬性

[英]'System.Web.UI.WebControls.ImageButton' does not have a public property named 'UpdateProgress'

在頁面中,我在更新面板中有一個網格和2個下拉列表。 從下拉列表中,用戶將選擇並保存選定的項目,並顯示在更新面板中。 我還計划與其一起使用updateprogress。

這樣做時,我收到此設計時錯誤“ “ System.Web.UI.WebControls.ImageButton”沒有名為“ UpdateProgress”的公共屬性”

我花了很多時間,但無法解決。 請幫我。 這是我的代碼。

  <tr>
        <td colspan="3">
            <div>
                <asp:Label runat="server" ID="Label1" Text="Update your professional experience below"></asp:Label>
                <asp:UpdatePanel runat="server" ID="upExperience">
                    <ContentTemplate>
                        <asp:DropDownList runat="server" AutoPostBack="true" ID="ddlCategory">
                        </asp:DropDownList>
                        <asp:DropDownList runat="server" ID="ddlValues">
                        </asp:DropDownList>
                        <asp:Button runat="server" ID="btnAddNew" Text="Add New" />
                        <asp:GridView runat="server" ID="gvExperience" AutoGenerateColumns="false">
                            <Columns>
                                <asp:BoundField DataField="Category" HeaderText="Category" />
                                <asp:BoundField DataField="Experience" HeaderText="Experience" />
                                <asp:BoundField DataField="Status" HeaderText="Status" />
                                <asp:TemplateField HeaderText="Remove">
                                    <ItemTemplate>
                                        <asp:ImageButton runat="server" ID="btnRemove" CommandArgument="<%#Eval("ID")%>" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:UpdateProgress runat="server" ID="upp">
                    <ProgressTemplate>
                        <img src="../Images/loading.gif" />
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </div>
        </td>
    </tr>

由於Eval周圍有兩個qoutes,因此ImageButton服務器控件的格式不正確,因此asp:UpdateProgress被視為標記的延續。 替換為:

<asp:ImageButton runat="server" ID="btnRemove" CommandArgument='<%#Eval("ID")%>' />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM