How to disable AJAX for using file upload in EditForm Template?

4 posts, 0 answers
  1. Jason M
    Jason M avatar
    8 posts
    Member since:
    Jan 2007

    Posted 15 Oct 2008 Link to this post

    I use RadUpload in the EditForm template in the RadGrid.
    My question is: How to disable AJAX when the user clicks "Insert" or "Update" button?

    The Javascript codes I used doesn't work:

     
    var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$","ig");  
     
    if (sender.EventTarget.match(theRegexp))  
    {  
      sender.EnableAjax = false;  

    Please look at the codes for RadUpload and buttons in EditForm at below

    <EditFormSettings EditFormType="Template">  
    <FormTemplate> 
    <table> 
      <tr> 
        <td>File:</td> 
        <td> 
          <telerik:RadUpload ID="RadUpload1" Skin="Vista" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" MaxFileSize="1000000" AllowedFileExtensions=".pdf" TargetPhysicalFolder="<%$ appSettings:UploadPath %>" /> 
        </td> 
      </tr> 
      <tr> 
        <td> 
          <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button> 
          <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button> 
        </td> 
        <td></td>  
      </tr> 
    </table> 
    </FormTemplate> 
    </EditFormSettings> 
     
     

    Thanks,Jason

  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 16 Oct 2008 Link to this post

    Hi Jason M,

    Please check this example for more info:
    http://demos.telerik.com/aspnet/Prometheus/Controls/Examples/Integration/RadUploadInAjaxifiedGrid/DefaultCS.aspx?product=grid

    Regards,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Jason M
    Jason M avatar
    8 posts
    Member since:
    Jan 2007

    Posted 16 Oct 2008 Link to this post

    Because I used the RadUpload in the EditForm template, the javascript codes in the example you mentioned doesn't work for me. Please help.

    Thanks.
  4. Jason M
    Jason M avatar
    8 posts
    Member since:
    Jan 2007

    Posted 17 Oct 2008 Link to this post

    I modified the Javascript codes to:

    var theRegexp = new RegExp("\.Update$|\.PerformInsert$","ig");     
        
    if (sender.EventTarget.match(theRegexp))     
    {     
      sender.EnableAjax = false;     
    }    
     

    And It works now.

    :-)
Back to Top