asp.net - collapsiblepanel collapse in code not collapsing -


i have panel have extended collapsible extender. working until try collapse code.

the collapsible panel shown inside modal popup user searches data, shown in grid , in every row of grid there select button fires row command event of grid on trying close panel.

markup:  <asp:modalpopupextender id="modalpopupextender1" runat="server" targetcontrolid="btnadd"         popupcontrolid="pnlpopup" cancelcontrolid="cancel" backgroundcssclass="modalbackground">     </asp:modalpopupextender>     <asp:panel id="pnlpopup" runat="server" backcolor="white" height="320px" width="530px"         style="display: none">         <table width="100%" style="border: solid 3px #d55500; height: 100%" cellpadding="0"             cellspacing="0">             <tr>                 <td>                     bridge id :                     <asp:textbox id="txtid" runat="server"></asp:textbox>                     <asp:requiredfieldvalidator id="rfvid" runat="server" controltovalidate="txtid" validationgroup="vldaddbridge"                         errormessage="please enter id" forecolor="red"></asp:requiredfieldvalidator>                 </td>                 <td>                     bridge name :                     <asp:textbox id="txtbridgename" runat="server"></asp:textbox>                     <asp:requiredfieldvalidator id="rfvbridgename" runat="server" controltovalidate="txtbridgename"                         validationgroup="vldaddbridge" errormessage="please enter bridge name." forecolor="red"></asp:requiredfieldvalidator>                 </td>             </tr>                                  <td colspan="2" style="text-align: right; margin-left: 40px;">                                     <asp:button id="btnsearchuser" runat="server" onclick="btnsearchuser_click" tabindex="5"                                         text="search" validationgroup="vgsearchmember" />                                 </td>                             </tr>                             <tr>                                 <td colspan="5" style="background-color: white" class="style6">                                     <asp:label id="lblsearchresults" runat="server"></asp:label>                                     <asp:gridview id="gvsearchresults" runat="server" allowpaging="true" autogeneratecolumns="false"                                         backcolor="white" borderwidth="1px" cellpadding="4" cssclass="gridviewborder"                                         datakeynames="empid" forecolor="black" gridlines="horizontal" pagesize="5" rowstyle-cssclass="style5"                                         tabindex="7" width="100%" onpageindexchanging="gvsearchresults_pageindexchanging"                                         onrowcommand="gvsearchresults_rowcommand">                                         <columns>                                             <asp:templatefield>                                                 <itemtemplate>                                                     <asp:linkbutton id="lnkselect" runat="server" text="select" commandname="select"                                                         commandargument='<%# eval("empid") %>'></asp:linkbutton>                                                 </itemtemplate>                                             </asp:templatefield>                                             <asp:boundfield datafield="empid" headertext="employee id" />                                             <asp:boundfield datafield="alias" headertext="username" />                                             <asp:boundfield datafield="firstname" headertext="first name" />                                             <asp:boundfield datafield="lastname" headertext="last name" />                                         </columns>                                      </asp:gridview>                                     <br />                                 </td>                             </tr>                         </table>                     </asp:panel>                     <asp:collapsiblepanelextender id="collapsiblepanelextender1" runat="server" collapsecontrolid="btnowner"                         expandcontrolid="btnowner" targetcontrolid="pnlregister" collapsed="true">                     </asp:collapsiblepanelextender>                 </td>             </tr>             <tr>                 <td align="center" colspan="2">                     <br />                     <asp:button id="btnsavebridge" runat="server" text="save" onclick="btnsavebridge_click"                         validationgroup="vldaddbridge" />                     <asp:button id="btncancel" runat="server" text="cancel" onclick="btncancel_click" />                     <span style="display: none">                         <input type="button" id="cancel" /></span>                 </td>             </tr>         </table>     </asp:panel>         code:      protected void gvsearchresults_rowcommand(object sender, gridviewcommandeventargs e)             {                 if (e.commandname == "select")                 {                      //some business logic                     collapsiblepanelextender1.collapsed = true;                     modalpopupextender1.show();                 }             } 

it not working panel open ?? suggestions.....

you missing

  • tr in design. please check it

markup:

<asp:modalpopupextender id="modalpopupextender1" runat="server" targetcontrolid="btnadd"         popupcontrolid="pnlpopup" cancelcontrolid="cancel" backgroundcssclass="modalbackground">     </asp:modalpopupextender>     <asp:panel id="pnlpopup" runat="server" backcolor="white" height="320px" width="530px"         style="display: none">         <table width="100%" style="border: solid 3px #d55500; height: 100%" cellpadding="0"             cellspacing="0">             <tr>                 <td>                     bridge id :                     <asp:textbox id="txtid" runat="server"></asp:textbox>                     <asp:requiredfieldvalidator id="rfvid" runat="server" controltovalidate="txtid" validationgroup="vldaddbridge"                         errormessage="please enter id" forecolor="red"></asp:requiredfieldvalidator>                 </td>                 <td>                     bridge name :                     <asp:textbox id="txtbridgename" runat="server"></asp:textbox>                     <asp:requiredfieldvalidator id="rfvbridgename" runat="server" controltovalidate="txtbridgename"                         validationgroup="vldaddbridge" errormessage="please enter bridge name." forecolor="red"></asp:requiredfieldvalidator>                 </td>             </tr>             **<tr> //this missing**                                 <td colspan="2" style="text-align: right; margin-left: 40px;">                                     <asp:button id="btnsearchuser" runat="server" onclick="btnsearchuser_click" tabindex="5"                                         text="search" validationgroup="vgsearchmember" />                                 </td>                             </tr>                             <tr>                                 <td colspan="5" style="background-color: white" class="style6">                                     <asp:label id="lblsearchresults" runat="server"></asp:label>                                     <asp:gridview id="gvsearchresults" runat="server" allowpaging="true" autogeneratecolumns="false"                                         backcolor="white" borderwidth="1px" cellpadding="4" cssclass="gridviewborder"                                         datakeynames="empid" forecolor="black" gridlines="horizontal" pagesize="5" rowstyle-cssclass="style5"                                         tabindex="7" width="100%" onpageindexchanging="gvsearchresults_pageindexchanging"                                         onrowcommand="gvsearchresults_rowcommand">                                         <columns>                                             <asp:templatefield>                                                 <itemtemplate>                                                     <asp:linkbutton id="lnkselect" runat="server" text="select" commandname="select"                                                         commandargument='<%# eval("empid") %>'></asp:linkbutton>                                                 </itemtemplate>                                             </asp:templatefield>                                             <asp:boundfield datafield="empid" headertext="employee id" />                                             <asp:boundfield datafield="alias" headertext="username" />                                             <asp:boundfield datafield="firstname" headertext="first name" />                                             <asp:boundfield datafield="lastname" headertext="last name" />                                         </columns>                                      </asp:gridview>                                     <br />                                 </td>                             </tr>                         </table>                     </asp:panel>                     <asp:collapsiblepanelextender id="collapsiblepanelextender1" runat="server" collapsecontrolid="btnowner"                         expandcontrolid="btnowner" targetcontrolid="pnlregister" collapsed="true">                     </asp:collapsiblepanelextender>                 </td>             </tr>             <tr>                 <td align="center" colspan="2">                     <br />                     <asp:button id="btnsavebridge" runat="server" text="save" onclick="btnsavebridge_click"                         validationgroup="vldaddbridge" />                     <asp:button id="btncancel" runat="server" text="cancel" onclick="btncancel_click" />                     <span style="display: none">                         <input type="button" id="cancel" /></span>                 </td>             </tr>         </table>     </asp:panel> 

hope solve problem


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -