jquery - Hiding placeholder inside updatepanel from asp.net -


i using updatepanel inside jquery popup on asp.net page. in updatepanel, have 2 placeholders. on 1 placeholder, have form buttons. when click save button, record saved in database. after record saved. want hide placeholder form.

and show other placeholder thank message. how can ?

i doing this:

registerph.visible = false; thankyouph.visible = true; modalupdatepanel.update(); 

my html markup this:

<asp:updatepanel id="modalupdatepanel" runat="server" updatemode="conditional">    <triggers>       <asp:asyncpostbacktrigger controlid="btnregister" eventname="click" />    </triggers>    <contenttemplate>       <asp:placeholder id="registerph" runat="server">       </asp:placeholder>       <asp:placeholder id="thankyouph" runat="server" visible="false">           <div class="row">               <div class="registertext2">                   <asp:literal id="thankyoucontentliteral" runat="server" text="<%$ resources:register, thankyoucontent %>" />               </div>           </div>      </asp:placeholder>   </contenttemplate> </asp:updatepanel> 

do need use updatepanel's endrequest function or register script ? please suggest.

that looks should work. make sure putting <asp:scriptmanager /> control on page (or radscriptmanager if using telerik, toolkitscriptmanager if using microsoft's ajaxtoolkit, etc.)

edit: following code works correctly using updatepanel , bootstrap modal dialog mentioned:

<%@ page language="c#" autoeventwireup="true" codebehind="bootstrap.aspx.cs" inherits="testweb.bootstrap" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>     <title></title>     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">     <link rel="stylesheet" href="css/bootstrap-theme.min.css">     <script src="scripts/jquery-1.8.2.js"></script>     <script src="js/bootstrap.min.js"></script> </head> <body> <form id="form1" runat="server">   <asp:scriptmanager id="scriptmanager1" runat="server" />   <a data-toggle="modal" href="#mymodal" class="btn btn-primary btn-lg">launch demo modal</a>   <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">     <div class="modal-dialog">       <div class="modal-content">         <div class="modal-header">           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>           <h4 class="modal-title">modal title</h4>         </div>         <div class="modal-body">             <asp:updatepanel id="upd" runat="server" updatemode="conditional">                 <contenttemplate>                 <asp:placeholder id="p1" runat="server">                     <asp:literal id="lit1" runat="server" text="placeholder 1" />                 </asp:placeholder>                 <asp:placeholder id="p2" runat="server" visible="false">                     <asp:literal id="lit2" runat="server" text="placeholder 2" />                 </asp:placeholder>                 </contenttemplate>                 <triggers>                     <asp:asyncpostbacktrigger controlid="btn" eventname="click" />                 </triggers>             </asp:updatepanel>         </div>         <div class="modal-footer">           <button type="button" class="btn btn-default" data-dismiss="modal">close</button>             <asp:button id="btn" runat="server" cssclass="btn btn-primary" text="save" onclick="btn_click" />         </div>       </div><!-- /.modal-content -->     </div><!-- /.modal-dialog -->   </div><!-- /.modal -->     </form> </body> </html> 

and in code-behind:

protected void btn_click(object sender, eventargs e) {     this.p1.visible = false;     this.p2.visible = true; } 

i encourage create test page in app markup confirm works in environment. assuming does, take problematic code , start pulling pieces out. maybe put same plain text in second placeholder control instead of couple of styled divs , literal pulls text resource file. comment out data update code save button doing toggling visibility on 2 placeholder controls. if still can't work after stripping page down bare minimum, post more of code , i'll take look.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -