asp.net - Button Inside Gridview Inside Update Panel Not Working -


i'm starting use update panels in solutions, i'm getting familiar them. have gridview has delete button associated each row displayed. when click on delete button, it's onclick event should displays panel acts semi-modal confirmation box (done lightbox) delete record associated relevant row. however, when click button, panel doesn't show because of in update panel. works fine without update panel

any ideas?

here's stripped down version of code:

<script runat="server"> protected sub linkbuttondelete_click(byval sender object, byval e eventargs)     panelconfirmmessage.visible = true     panelconfirmlightbox.visible = true end sub '.... note there other code handles delete ... </script>  <html> <head"></head> <body> <form id="form1" runat="server">     <asp:updatepanel id="updatepanel1" runat="server">         <contenttemplate>             <asp:gridview id="gridview1" runat="server" datasourceid="datasourcegridview1">                 <columns>                     <asp:templatefield headertext="name">                         <itemtemplate><asp:textbox id="textbox1" runat="server" text='<%# bind("myfieldname") %>' /></itemtemplate>                     </asp:templatefield>                     <asp:templatefield headertext="delete">                         <itemtemplate><asp:linkbutton id="linkbuttondelete" runat="server" onclick="linkbuttondelete_click"></asp:linkbutton></itemtemplate>                     </asp:templatefield>                 </columns>             </asp:gridview>             <asp:sqldatasource id="datasourcegridview1" runat="server" connectionstring="<%$ connectionstrings:mystring %>" selectcommand="myselectcommand" selectcommandtype="storedprocedure"></asp:sqldatasource>         </contenttemplate>     </asp:updatepanel>     <asp:panel runat="server" id="panelconfirmmessage" visible="false">         <p>are sure want continue?</p>         <asp:button runat="server" id="buttonyes" text="yes" onclick="buttonyes_click" />         <asp:button runat="server" id="buttonno" text="no" onclick="buttonno_click" />     </asp:panel>     <asp:panel runat="server" id="panelconfirmlightbox" visible="false"></asp:panel> </form> </body> </html> 

thanks help. provided answer through of else. answer simple. had place confirmation inside update panel along else.

shortened version fix:

<asp:updatepanel id="updatepanel1" runat="server">     <contenttemplate>         <asp:gridview id="gridview1"...>             <columns>....</columns>         </asp:gridview>         <asp:sqldatasource ...></asp:sqldatasource>          <!--- confirmation panels inside updatepanel shown here --->          <asp:panel runat="server" id="panelconfirmmessage" visible="false">         ...         </asp:panel>         <asp:panel runat="server" id="panelconfirmlightbox" visible="false"></asp:panel>     </contenttemplate> </asp:updatepanel> 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -