c# - Update dropdownlist on a Panel -


i have 2 dropdownlists in panel pops up. when change 1 value in first dropdownlist want populate seconde dropdownlist value chosen in first dropdownlist. have autopostback = "true" page refreshing , popup disappears. when in fact want update panel on popup.

i´m using asyncpostbacktrigger i´m newbie in kind of stuff, bare me if i´m doing wrong.

<asp:modalpopupextender id="modalpopupextender1" runat="server" targetcontrolid="btnshowpopup"             popupcontrolid="pnlpopup" cancelcontrolid="btncancel" backgroundcssclass="modalbackground">     </asp:modalpopupextender> <asp:panel id="pnlpopup" runat="server" backcolor="white" height="199px" width="400px"         style="display: none">         <table width="100%" style="border: solid 3px #d55500; width: 100%; height: 100%"             cellpadding="5" cellspacing="0">             <tr style="background-color: #d55500">                 <td colspan="2" style="height: 10%; color: white; font-weight: bold; font-size: larger"                     align="center">                     insert product                 </td>             </tr>              <asp:updatepanel id="updatepanel1" runat="server">                 <contenttemplate>                     <tr>                         <td align="right" style="width: 45%">                             category:                         </td>                         <td>                              <asp:dropdownlist autopostback="true" runat="server" id="dropdownlist1" onselectedindexchanged="dropdownlist_change" />                         </td>                     </tr>                     <tr>                         <td align="right">                             product:                         </td>                         <td>                             <asp:dropdownlist id="dropdownlist2" runat="server">                             </asp:dropdownlist>                         </td>                     </tr>                 </contenttemplate>                 <triggers>                      <asp:asyncpostbacktrigger controlid="dropdownlist1" eventname="selectedindexchanged" />                  </triggers>              </asp:updatepanel>             <tr>                 <td>                 </td>                 <td>                     <asp:label id="popup_modo" runat="server" visible="false"></asp:label>                     <asp:button id="btncommand" commandname="update" runat="server" text="update" onclick="btnupdate_click" />                     <asp:button id="btncancel" runat="server" text="cancel" />                 </td>             </tr>         </table>     </asp:panel> 

try this:

<asp:panel id="pnlpopup" runat="server" backcolor="white" height="199px" width="400px"         style="display: none">         <table width="100%" style="border: solid 3px #d55500; width: 100%; height: 100%"             cellpadding="5" cellspacing="0">             <tr style="background-color: #d55500">                 <td colspan="2" style="height: 10%; color: white; font-weight: bold; font-size: larger"                     align="center">                     insert product                 </td>             </tr>                       <tr>                         <td align="right" style="width: 45%">                             category:                         </td>                         <td>                              <asp:dropdownlist autopostback="true" runat="server" id="dropdownlist1" onselectedindexchanged="dropdownlist_change" />                         </td>                     </tr>                     <tr>                         <td align="right">                             product:                         </td>                         <td>  <asp:updatepanel id="updatepanel1" runat="server">                 <contenttemplate>                             <asp:dropdownlist id="dropdownlist2" runat="server">                             </asp:dropdownlist></contenttemplate>                 <triggers>                      <asp:asyncpostbacktrigger controlid="dropdownlist1" eventname="selectedindexchanged" />                  </triggers>              </asp:updatepanel>                         </td>                     </tr>              <tr>                 <td>                 </td>                 <td>                     <asp:label id="popup_modo" runat="server" visible="false"></asp:label>                     <asp:button id="btncommand" commandname="update" runat="server" text="update" onclick="btnupdate_click" />                     <asp:button id="btncancel" runat="server" text="cancel" />                 </td>             </tr>         </table>     </asp:panel> 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -