0

I need to get the value of an asp.net fileupload into Ajax parameter and i'm trying to do like this:

$('#<%=fileUpload.ClientID%>').val() 

//and in the WebMethod  
[WebMethod]
public static List<AjaxCategory> AddCategory(FileUpload categoryImage)

I don't know if it is possible or not, but like this is not working

MethodMan
  • 18,625
  • 6
  • 34
  • 52
Eliza
  • 135
  • 1
  • 4
  • 15
  • `Eliza` look at this previous stackoverflow posting and see if it helps http://stackoverflow.com/questions/12726172/how-do-i-use-ajax-to-upload-files-to-asp-net – MethodMan Feb 05 '13 at 19:10
  • no becuase I'm using ASP FileUpload – Eliza Feb 05 '13 at 19:13
  • Eliza can you show the aspx code for the page also have you tried getting at the value from the document level using the `document.getElementById("Name of your TextBox");` you could also use JavaScript. I am not sure what you are trying to do with that static method because you haven't provided enough information either – MethodMan Feb 05 '13 at 19:23

1 Answers1

1

Async file upload requires some additional setup. Look to using a utility like:

Brian Mains
  • 50,520
  • 35
  • 148
  • 257