Herlan

Herlan

  • NA
  • 215
  • 2.9k

problem with the FileUpload when making the postback

Sep 20 2016 2:26 PM
Hello, I have a GridView which charge user data, selecting one lifts the panel through a ModalPopupExtender, this panel has UpdatePanel nested as you can see in the code, pressing the save button closes the Popup, can not find the error. help me with this problem.
Removing the UpdatePanel of FileUpload does not close the Popup but you can not upload files on the HasFile of FileUpload always be false.
  1. <asp:Panel ID="pDatos" runat="server" BackColor="#E0E0E0">  
  2.     <table>  
  3.        <tr>  
  4.           <td>  
  5.              <asp:GridView runat="server" ID="gvResultado" AutoGenerateColumns="false"  
  6.                            OnRowCommand="gvResultado_OnRowCommand" DataKeyNames="Id, Estado" >  
  7.                    <Columns>  
  8.                         <asp:ButtonField DataTextField="Id" ItemStyle-ForeColor="Black"  
  9.                                          ControlStyle-CssClass="hover" CommandName="gvResultado"  
  10.                                          HeaderText="Verificar"/>  
  11.                         <asp:BoundField DataField="Nombre" HeaderText="Nombre" ItemStyle-Width="320px" />  
  12.                         <asp:BoundField DataField="Observaciones" HeaderText="Observaciones" ItemStyle-Width="360px" />  
  13.                         <asp:BoundField DataField="Fecha" HeaderText="Fecha" />  
  14.                         <asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-Width="120px" />  
  15.                    </Columns>  
  16.                </asp:GridView>  
  17.             </td>  
  18.          </tr>  
  19.      </table>  
  20. </asp:Panel>  
  21. <asp:HiddenField ID="hfPopup" runat="server" />  
  22.   
  23. <ajax:ModalPopupExtender ID="mpePopup" runat="server" PopupControlID="pPopup"  
  24.                          TargetControlID="hfPopup" BackgroundCssClass="backgroundColor">  
  25. </ajax:ModalPopupExtender>  
  26.   
  27. <asp:Panel ID="pPopup" runat="server" BackColor="#CFCFCF" Style="display: none" >  
  28.     <asp:UpdatePanel ID="upPopup" runat="server">  
  29.         <ContentTemplate>  
  30.             <table style="width:740px;" align="center">  
  31.                 <tr>  
  32.                     <td align="center" colspan="2">  
  33.                         <asp:GridView runat="server" ID="gvHistorial" AutoGenerateColumns="false"  
  34.                                       OnRowCommand="gvHistorial_RowCommand" DataKeyNames="Descargar" >  
  35.                             <Columns>  
  36.                                 <asp:BoundField DataField="Legajo" HeaderText="Legajo" ItemStyle-Width="100"/>  
  37.                                 <asp:BoundField DataField="Observaciones" HeaderText="Observaciones" ItemStyle-Width="550" />  
  38.                                 <asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-Width="150"/>  
  39.                                 <asp:ButtonField DataTextField="Descargar" HeaderText="Descargar" CommandName="gvHistorial_Descargar" />  
  40.                             </Columns>  
  41.                         </asp:GridView>  
  42.                     </td>  
  43.                 </tr>  
  44.                 <tr>  
  45.                     <td><!-- --></td>  
  46.                     <td >  
  47.                         <asp:UpdatePanel ID="upArchivo" runat="server" UpdateMode="Conditional">  
  48.                             <ContentTemplate>  
  49.                                 <asp:FileUpload ID="luSeleccione" runat="server" />  
  50.                             </ContentTemplate>  
  51.                            <Triggers>  
  52.                                 <asp:PostBackTrigger ControlID="bGuardar" />  
  53.                             </Triggers>  
  54.                         </asp:UpdatePanel>  
  55.                     </td>  
  56.                 </tr>  
  57.                 <tr>  
  58.                     <td><!-- --></td>  
  59.                     <td align="left">  
  60.                         <asp:Button runat="server" ID="btnGuardar" OnClick="btnGuardar_Click"  
  61.                                     Text="Guardar" CssClass="Button hover" />  
  62.                             
  63.                         <asp:Button runat="server" ID="btnSalir" OnClick="btnSalir_Click"  
  64.                                     Text="Salir" CssClass="Button hover" />  
  65.                     </td>  
  66.                 </tr>  
  67.             </table>  
  68.         </ContentTemplate>  
  69.     </asp:UpdatePanel>  
  70. </asp:Panel>  
 

Answers (1)