Hi,
I have a regular asp:FileUpload in a template in a grid.
It works fine to upload if ajax is not enabled but with ajax it wont work.
Javascript errormessage:
Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
I have looked at your demo and to use onrequeststart on the panel,
http://demos.telerik.com/aspnet-ajax/ajax/examples/common/fileupload/defaultcs.aspx
but I cant figure out what's wrong!
I have a regular asp:FileUpload in a template in a grid.
It works fine to upload if ajax is not enabled but with ajax it wont work.
Javascript errormessage:
Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
I have looked at your demo and to use onrequeststart on the panel,
http://demos.telerik.com/aspnet-ajax/ajax/examples/common/fileupload/defaultcs.aspx
but I cant figure out what's wrong!
| <script type="text/javascript"> |
| function OnRequestStart(target, arguments) { |
| if (document.getElementById("FileUpload2") != null) { |
| var fileUpload = document.getElementById("FileUpload2"); |
| if (fileUpload.value != "") { |
| arguments.set_enableAjax(false); |
| } |
| } |
| } |
| </script> |
| <telerik:RadAjaxPanel runat="server" ID="radAjaxPanel" Width="100%" LoadingPanelID="radAjaxLoadingPanel" ClientEvents-OnRequestStart="OnRequestStart"> |
| <telerik:RadGrid ID="RadGrid1" |
| ... |
| <EditFormSettings EditFormType="Template"> |
| <FormTemplate> |
| <input id="FileUpload2" type="file" runat="server" class="fileUpload" /> |
| <asp:Button ID="buttonUploadFile" Text="Ladda upp" runat="server" ValidationGroup="validationGroupFile" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' CommandArgument="File" /> |