This is a migrated thread and some comments may be shown as answers.

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

3 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason M
Top achievements
Rank 2
Jason M asked on 15 Oct 2008, 09:03 PM

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

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Oct 2008, 06:42 AM
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.
0
Jason M
Top achievements
Rank 2
answered on 16 Oct 2008, 01:41 PM
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.
0
Jason M
Top achievements
Rank 2
answered on 17 Oct 2008, 02:31 PM
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.

:-)
Tags
Grid
Asked by
Jason M
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Jason M
Top achievements
Rank 2
Share this question
or