[CLOSED] Save File dialogbox coming when IsUPload="true"

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Save File dialogbox coming when IsUPload="true"

    Hi am getting error when i upload files using Fileupload control.

    
     <DirectEvents>
                                                    <Click 
                                                        Url="/Data/Validate/" 
                                                        Timeout="60000"
                                                        FormID="GeneralForm"
                                                        CleanRequest="true"
                                                        IsUpload="true" 
                                                        Method="POST"
                                                       Failure="Ext.Msg.show({
                                                       title:   'Error',
                                                       msg:     result.errorMessage,
                                                       buttons: Ext.Msg.OK,
                                                       icon:    Ext.MessageBox.ERROR
                                                    });">
                                                    <EventMask MinDelay="250" />
                                                        
                                                      
                                                        <ExtraParams>  
                                                          <ext:Parameter Name="City" Value="#{cbocity}.getValue()" Mode="Raw" />
                                                           <ext:Parameter Name="Country" Value="#{cboCountry}.getValue()" Mode="Raw" />
                                                            <ext:Parameter Name="valid" Value="#{GeneralForm}.isValid()" Mode="Raw" />
                                                        </ExtraParams>
                                                    </Click>
                                                </DirectEvents>
    if i change it to False it works but then i cant save files which are uploaded

    HttpPostedFileBase hpfbaseHeader = Request.Files["FUFile"] as HttpPostedFileBase;

    Comes Null
    Last edited by Daniil; Oct 27, 2010 at 8:00 PM. Reason: [CLOSED]
  2. #2
    Hi,

    To correct file upload you have to have a form (FormPanel or html form). For example, your button should placed inside form or you can create form anywhere and set FormID for direct event
  3. #3
    Please have a look
    
      <ext:ViewPort ID="ViewPort1" runat="server" Layout="fit" >
    
            <Items>
               <ext:TabPanel ID="tbPanel" runat="server" Border="false" LayoutOnTabChange="true" EnableTabScroll="true">
                            <Items>
                                   
                                  <ext:Panel ID="ValidatePnl" 
                                    runat="server" 
                                    Title="Enquiry"
                                    Icon="PageEdit"
                                    Padding="1" 
                                    Layout="form">
                                    <TopBar>
                                      <ext:Toolbar ID="Toolbar1" runat="server">
                                       <Items>
                                            <ext:Button ID="Button3" runat="server" Icon="Tick" Text="Validate">
                                              <DirectEvents>
                                                    <Click 
                                                        Url="/Data/Validate/" 
                                                        Timeout="60000"
                                                        FormID="GeneralForm"
                                                        CleanRequest="true"
                                                        IsUpload="true" 
                                                        Method="POST"
                                                       Failure="Ext.Msg.show({
                                                       title:   'Error',
                                                       msg:     result.errorMessage,
                                                       buttons: Ext.Msg.OK,
                                                       icon:    Ext.MessageBox.ERROR
                                                    });">
                                                    <EventMask MinDelay="250" />
                                                        
                                                      
                                                        <ExtraParams>  
                                                           <ext:Parameter Name="City" Value="#{cboCity}.getValue()" Mode="Raw" />
                                                           <ext:Parameter Name="Country" Value="#{cboCountry}.getValue()" Mode="Raw" />
                                                           <ext:Parameter Name="valid" Value="#{GeneralForm}.isValid()" Mode="Raw" />
                                                        </ExtraParams>
                                                    </Click>
                                                </DirectEvents>
                                            </ext:Button>
                                            <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server" />
                                            <ext:Button ID="Button4" runat="server" Icon="Delete" Text="Clear All">
                                               <Listeners>
                                                    <Click Handler="#{FUFile}.clear();" />   
                                               </Listeners>   
                                            </ext:Button>
                                             <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                            
                                        </Items>
                                    </ext:Toolbar>
                                   </TopBar>
                                        <Items>
                                            <ext:FormPanel
                                                Frame="true" 
                                                Border="false"
                                                RenderFormElement="true" 
                                                ID="GeneralForm" 
                                                runat="server"
                                                MonitorPoll="500" 
                                                MonitorValid="true" 
                                                Layout="Form">
                                                <Items>
                                                    <ext:ComboBox ID="cboCity" runat="server"
                                                               StoreID="dsCity"
                                                               SelectedIndex="0"
                                                               ColumnWidth="0.5"
                                                              Mode="Local"            
                                                              Editable="false"
                                                              AllowBlank="false"
                                                              FieldLabel="City"
                                                              DisplayField="display"
                                                              AutoWidth="true"
                                                              Width="220"
                                                              LabelAlign="Left"         
                                                              ValueField="no">
                                                           <SelectedItem Value='<%# this.TempData["City"]%>' AutoDataBind="true" />
                                                        </ext:ComboBox>
    
                                                 <ext:ComboBox ID="cboCountry" runat="server"
                                                               StoreID="dsCountry"
                                                               SelectedIndex="0"
                                                               ColumnWidth="0.5"
                                                              Mode="Local"            
                                                              Editable="false"
                                                              AllowBlank="false"
                                                              AutoWidth="true"
                                                              FieldLabel="Country"
                                                              LabelAlign="Left" 
                                                              Width="220" 
                                                               DisplayField="display"
                                                              ValueField="Name">
                                                        </ext:ComboBox>
    
                                               
                                                     <ext:FileUploadField ID="FUFile" Name="FUFile" Width="200" runat="server" FieldLabel="Order Header file" Icon="ScriptAdd" AllowBlank="false"  AnchorHorizontal="55%"  >
                                                     </ext:FileUploadField>
                                                   
                                                    <ext:FileUploadField ID="FUDetail" Name="FUDetail" Width="200" runat="server" FieldLabel="Order Lines file" AllowBlank="false" Icon="ScriptAdd" AnchorHorizontal="55%" />
                                                </Items>
                                            </ext:FormPanel>
                                        </Items>
                                  </ext:Panel>
    
                                   <ext:Panel ID="ResultsPnl" 
                                    runat="server" 
                                    Title="Results"
                                    Icon="PageEdit"
                                    Hidden="false"
                                    Padding="1" 
                                    Layout="form">
                                        <Items>
                                            <ext:FormPanel
                                                Frame="true" 
                                                Border="false" 
                                                ID="ResultForm" 
                                                runat="server"
                                                MonitorPoll="500" 
                                                MonitorValid="true" 
                                                Layout="Form">
                                                 
                                                <Items>
                                                    <ext:TextField ID="txtPurchaseOrderNo" runat="server" FieldLabel="Purchase Order No" AnchorHorizontal="60%"  />
                                                   <ext:ComboBox ID="cbotype" runat="server" SelectedIndex="0" FieldLabel="Purchase Order Type" AnchorHorizontal="60%" >
                                                     <Items>
                                                       <ext:ListItem Text="Daily" Value="D" />
                                                       <ext:ListItem Text="Stock" Value="S" />
                                                       <ext:ListItem Text="Emergency" Value="E" />
                                                     </Items>
                                                   </ext:ComboBox>
                                                 <ext:TextArea ID="txtDeliveryInstructions" runat="server" FieldLabel="Delivery Instructions" AnchorHorizontal="60%" />
                               
                                                </Items>
                                            </ext:FormPanel>
                                        </Items>
                                   </ext:Panel>
                            </Items>
                </ext:TabPanel>
            </Items>
        </ext:ViewPort>
    Am using MVC 2

    This is my controller action

    [AcceptVerbs(HttpVerbs.Post)]
            public ActionResult Validate(FormCollection coll, string City, string Country ,bool valid)
            {
    
                 AjaxFormResult response = new AjaxFormResult();
    }
    Last edited by Daniil; Oct 21, 2010 at 9:54 AM. Reason: Please use [CODE] tags
  4. #4
    Hi,

    Why do you use AjaxFormResult? I guess that you have to use AjaxResult.
    And pelase set IsUpload = true for result
    [AcceptVerbs(HttpVerbs.Post)]
            public ActionResult Validate(FormCollection coll, string City, string Country, bool valid)
            {
                AjaxResult response = new AjaxResult();
                response.IsUpload = true;
                return response;
            }
  5. #5
    Hi Vladimir, I did exactly what you replied in post but still save messagebox comes up and when i save file.
    Contents are 2 curly brackets {}.
  6. #6
    Hi,

    Can you show action code? Or is it same as my code? Can you create simple test project (without any assemblies)? Are you sure that you set IsUpload = true for AjaxResult class?
  7. #7
    Am attaching aspx file and controller code. Pls have a look
    Test.zip
  8. #8
    Hi,

    Still cannot reproduce it. If IsUpload to set to true then no save dialog. Under which browsers you reproduces the issue?
    Try to update Ext.Net toolkit and Ext.Net.MVC (https://extnet-mvc.googlecode.com/svn/trunk) from SVN and retest.
    Also try to return EmptyResult from the action and post the result of that test.

    NOTE: Marked as solved. No more information was provided.
    Last edited by Daniil; Oct 27, 2010 at 7:59 PM. Reason: Added note
  9. #9
    You can mark this as solved. The problem was that I was returning an AjaxFormResult instead of just an AjaxResult, sorry.

    Thanks for your help.
  10. #10
    Hi Peter,

    Do you work with @webppl in the team? Or did you just confirm that it works?
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Hidden="true" behaves as Visible="false"
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 28, 2012, 3:17 PM
  2. Replies: 16
    Last Post: May 18, 2012, 7:29 AM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. [CLOSED] DropDownField with Grow="true" and GrowMax="xxx"
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 12, 2012, 12:00 PM
  5. [CLOSED] renderScripts="File" renderStyles="File" adding extra '/'
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Nov 24, 2011, 12:23 PM

Tags for this Thread

Posting Permissions