如何避免下拉列表中的页面加载

如何避免下拉列表中的页面加载

本文介绍了如何避免下拉列表中的页面加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:Label ID="Label1" runat="server" Text="select Name of project           :-"></asp:Label>
            <%--  <asp:DropDownList ID="DropDownList1" runat="server" class="form-control"></asp:DropDownList>--%>
                   <asp:DropDownList ID="DropDownList1" runat="server"    class="form-control"    AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" ></asp:DropDownList>
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownList1" ErrorMessage="Please Enter Project Name.." ForeColor="#FF5050"></asp:RequiredFieldValidator>


                  </div>           </div>

推荐答案

<asp:ScriptManager ID="ScriptManager"

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

                            UpdateMode="Conditional"

                            runat="server">
               <ContentTemplate>
                 <asp:dropdownlist id="DropDownList1" runat="server" class="form-control" autopostback="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged" xmlns:asp="#unknown"></asp:dropdownlist>
                       <asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" controltovalidate="DropDownList1" errormessage="Please Enter Project Name.." forecolor="#FF5050" xmlns:asp="#unknown"></asp:requiredfieldvalidator>
               </ContentTemplate>
           </asp:UpdatePanel>




祝你好运.




Good luck.


这篇关于如何避免下拉列表中的页面加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-14 06:58