Click here to Skip to main content
11,639,861 members (58,970 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
I have a gridview with an asyncfileupload control.
In general it works, but ONLY on the first row in the gridview

I get the
error: Unhandled Exception: The file attached is invalid.

but all rows are updated using Asyncfileupload except first rows............
WebConfig:
pages enableEventValidation="false" validateRequest="false" viewStateEncryptionMode="Never" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"

All three Solution ,I try
My Problem is not Solving.....
Posted 11-Sep-12 19:38pm
Edited 12-Sep-12 1:28am
v7
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hello,

If you are using the Async file uploader control in AJAX Toolkit inside an update panel. when you select a file to upload, after selection, the file uploader control will be showing with Red background in the text field.

The fix for this problem is: click on the properties of the async file uploader control -> find ClientIDMode property -> change it from inherit to Auto ID.

Now try to build your web app. and select a file, The control will show the selected file with green background which means it is a valid input file validation being done by the control itself.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

There is some conflicts in your page. enableEventValidation will be true by default for the page. This will validate the aspx page to the server. Try making that false in your page directive.
Try this:
<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Fire_PreQuote"
EnableEventValidation="false" %>



--Amit
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Just add the ClientIDMode="AutoID" option to AJax control & everything will work like a charm
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

I had the same problem. I had a template field with an async file upload control in the edit and footer templates. Whenever I tried to upload the file in the first row, it gave this error. I went into the async file control in the edit template and changed the ClientIDMode to 'Static'. The problem went away. I left the ClientIDMode as 'AutoID' in the footer.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Suvendu Shekhar Giri 330
1 CPallini 177
2 F-ES Sitecore 170
3 sasanka sekhar panda 155
4 jyo.net 142
0 OriginalGriff 9,081
1 Sergey Alexandrovich Kryukov 8,847
2 Mika Wendelius 7,027
3 Suvendu Shekhar Giri 2,650
4 F-ES Sitecore 2,558


Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 23 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100