0

我的在线订单有问题,我已将所有下拉列表和按钮放在更新面板中,但是当我在下拉列表中选择某些内容或按下按钮时,整个页面发回...请帮助我!这是我的代码:` <%----%>            

                            <strong><asp:ImageButton 
                                ID="btnExcel0" runat="server" AlternateText="Export to Excel" Height="30px" 
                                ImageUrl="/images/excel_icon1.png" onclick="btnExcel_Click" TabIndex="14" />
                            </strong>&nbsp; &nbsp;&nbsp;
                             <input type="image" runat ="server" id ="Image1" src ="/images/images.jpg" onclick="javascript:CallPrint('divPivot1')" title="Print" />

                            <br />
                            <div id= "divPivot1">
                            <asp:GridView ID="OrderGridView" runat="server" AllowPaging="True" 
                                BorderStyle="None" CellPadding="3" DataKeyNames="Article" 
                                EmptyDataText="&quot;No product added...&quot;" Font-Size="Small" HorizontalAlign="Left" 
                                OnPageIndexChanging="OrderGridView_PageIndexChanging" PageSize="20" 
                                TabIndex="15" Width="866px" BackColor="White" BorderColor="#CCCCCC" 
                                BorderWidth="1px">
                                <FooterStyle BackColor="White" ForeColor="#336699" />
                                <HeaderStyle BackColor="#336699" Font-Bold="True" ForeColor="White" />
                                <PagerSettings FirstPageText="First" LastPageText="Last" />
                                <PagerStyle BackColor="White" ForeColor="#336699" HorizontalAlign="Left" />
                                <RowStyle ForeColor="#336699" Font-Size="Small" />
                                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                <SortedDescendingHeaderStyle BackColor="#00547E" />
                                <Columns>
                                    <asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Center" >
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server" />
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                     <asp:TemplateField HeaderText="Update Quantity" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="80">
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox" runat="server" Width="90" />
                                    </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
        br />
                                <br />
                               <asp:Label ID="lblsum" runat="server" CssClass="style19" Text="Sum Total"></asp:Label>
                            <br />
                               <asp:Label ID="sum" runat="server" CssClass="style19"></asp:Label>
                            <br />
                            </div>
                            <strong><asp:ImageButton ID="btnDelete" runat="server" Height="28px" 
                                    ImageUrl="/images/bt_Delete.jpg" onclick="btnDelete_Click" 
                                    OnClientClick="return DeleteConfirmation();" TabIndex="13" Width="106px" />
                                </strong>&nbsp;&nbsp;&nbsp; &nbsp;<asp:ImageButton ID="btnUpdate" 
                                    runat="server" Height="28px" ImageUrl="/images/btUpdate.jpg" Width="106px" 
                                    OnClientClick="return UpdateConfirmation();" 
                                    onclick="btnUpdate_Click" />
                            <asp:TextBox ID="username" runat="server" Height="16px" Visible="False" 
                                    Width="128px"></asp:TextBox>
                            <br />

                            <asp:Label ID="Label16" runat="server" Text="Notes:" ForeColor="#336699"></asp:Label>

                            <br />
                            <asp:TextBox ID="TextBox5" runat="server" Height="101px" TabIndex="10" 
                                TextMode="MultiLine" Width="860px"></asp:TextBox>
                            <br />
                            &nbsp;&nbsp;<asp:ImageButton 
                                ID="btnSend" runat="server" ImageUrl="/images/mail2.jpg" 
                                onclick="Button1_Click"  AlternateText="Send your Order"
                                TabIndex="11" Height="75px" Width="90px"/><strong><asp:ImageButton 
                                ID="ImageButton1" runat="server" Height="66px" 
                                ImageUrl="/images/logout.png"  Width="56px" 
                                 onclick="ImageButton1_Click" />
                            </strong>
                            <br />
                            <strong>
                            <asp:Label ID="Label18" runat="server" style="color: #336699" 
                                Text="*Delete Product from List: Check the products which you want to remove from your list and press the delete button."></asp:Label>
                            </strong>
                    </ContentTemplate>
                    <Triggers>
                        <asp:PostBackTrigger ControlID="btnExcel0" />
                        <asp:AsyncPostBackTrigger ControlID="ImageButton1" />
                        <asp:AsyncPostBackTrigger ControlID="code" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostBackTrigger ControlID="type" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostBackTrigger ControlID="p" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostBackTrigger ControlID="dem" EventName="SelectedIndexChanged" />
                        <asp:AsyncPostBackTrigger ControlID="quant" EventName="TextChanged" />
                        <asp:AsyncPostBackTrigger ControlID="btnAdd" />
                        <asp:AsyncPostBackTrigger ControlID="btnDelete" />
                        <asp:AsyncPostBackTrigger ControlID="btnUpdate" />
                        <asp:AsyncPostBackTrigger ControlID="btnSend" />
                    </Triggers>
                </asp:UpdatePanel>`
4

1 回答 1

0

我看不到您的下拉列表的代码,我曾经遇到过同样的问题。我设置下拉列表 AutoPostBack= True 并在选定的索引中定义一个方法已更改。因此,请确保您没有这样做并上传完整的代码。

于 2013-04-22T12:10:28.957 回答