按钮在更新面板中不起作用 [英] button is not working inside update panel

查看:74
本文介绍了按钮在更新面板中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:UpdatePanel ID="UpdatePanel2" runat="server"  UpdateMode="Always" ChildrenAsTriggers="true" EnableViewState="true">
                  <triggers>
                      <asp:PostBackTrigger ControlID="ddlregion" />
                      <asp:PostBackTrigger ControlID="ddldivision" />
                   <asp:PostBackTrigger ControlID="ddldistrict" />
                      <asp:PostBackTrigger ControlID="ddlchain" />
                      <asp:PostBackTrigger ControlID="ddlstore" />
                      <asp:AsyncPostBackTrigger ControlID="srcStore"  EventName="Click"/>
                  </triggers>
        <contenttemplate>

       
             <a href="#" id="swapper">Advance Search</a> 

             <div id="usrdiv" class="input-group innerB">  
                    
       <input type="text" runat="server" class="form-control" placeholder="Search Store" ID="txtSearch" />
      		<span class="input-group-btn">
                  
                  <button class="btn btn-primary rounded-none" id="srcStore" runat="server" onserverclick="srcStore_Click"  type="button">
        		</button>
      		</span>
  
</div>
         
             <div class="dropdown-toggle1 dropdown">
                  <div class="bottom-margin"> 
              <div id="fltrdiv" style="display:none">                    
                <table style="width:100%"> 
                <thead>                
				<tr>
					<th class="center" style="width:16%">Region</th>
                    <th class="center" style="width:16%">Division</th>
                    <th class="center" style="width:16%">District</th>
                    <th class="center" style="width:16%">Chain</th>
                    <th class="center" style="width:16%">Store</th>
					<th class="center" style="width:20%">User</th>							                   
				</tr>
			</thead>           
               <tr>
                <td style="width:16%"><asp:DropDownList runat="server" CssClass=".dropdown-toggle1.dropdown select.my-select" ID="ddlregion" ClientIDMode="Static" /> </td>
                <td style="width:16%"><asp:DropDownList runat="server" CssClass=".dropdown-toggle1.dropdown select.my-select" ID="ddldivision" ClientIDMode="Static" /> </td>
                <td style="width:16%"><asp:DropDownList runat="server" CssClass=".dropdown-toggle1.dropdown select.my-select" ID="ddldistrict" ClientIDMode="Static" /> </td>
                <td style="width:16%"><asp:DropDownList runat="server" CssClass=".dropdown-toggle1.dropdown select.my-select" ID="ddlchain" ClientIDMode="Static" /> </td>
                <td style="width:16%"><asp:DropDownList runat="server" CssClass=".dropdown-toggle1.dropdown select.my-select" ID="ddlstore" ClientIDMode="Static" /> </td>
                <td style="width:20%"><asp:DropDownList runat="server" CssClass=".dropdown-toggle1.dropdown select.my-select" ID="ddluser" ClientIDMode="Static" /></td>
               
                       </tr>
                   
                </table>                   
                  </div>         
              <asp:Label runat="server" Visible="false" ID="lblstr" ClientIDMode="Static">
            <div class="clr"></div> </div>  
                
            </div>
         </contenttemplate>
            
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
               <triggers>
                   <asp:PostBackTrigger ControlID="ddluser" />
                                  
           </triggers>
           <contenttemplate>

           <div class="bottom-margin"> 
                 <div id="mapdiv" style="width: 100%; height: 400px">
                          <asp:UpdateProgress runat="server" >
                                <progresstemplate>
                                    <img src="Images/loader_anim1.gif" />                                               
                               </progresstemplate>
                            
                        </div>

            </div>
               </contenttemplate>

推荐答案

您需要清理标记:



1:标签标签未关闭

2:UpdatePanel1未关闭

3a:摆脱触发。无论如何,你有孩子作为触发器..

3b:或点击html按钮的事件名称是'ServerClick'
you need to clean up your markup:

1: A label tag is not closed
2: UpdatePanel1 is not closed
3a: get rid of the triggers. You have children as triggers anyway..
3b: or The event name for an html button click is 'ServerClick'


这篇关于按钮在更新面板中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆