HTML Form inside ASP.NET form and fileupload

  • Thread starter Thread starter admlangford
  • Start date Start date
A

admlangford

Hi, I have an ASP.NET page which obviously uses a server side form.

I want a client to be able to add an HTML form to a page via a WYSIWYG
editor and this will be a basic HTML fileinput form with a submit
button.

The above renders fine but in my codebehind in the !Page.IsPostBack in
the Page_Load event I do the following

Response.Write(Request.Files.Count.ToString());

and the value is always 0, even when I upload an image via the basic
HTML fileinput form

Can anyone help me about what I am doing wrong here?

Thanks
Adam
 
Hello (e-mail address removed),

does your client's added form have the runat="server" attribute?!
I'd recommend to test the actions on the standard page - take the source
of your generated page and try to do the same in asp.net page
and you will find the source of your problem easily

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 
Hi Michael, thanks for the suggestions.

In the end it was my own silly fault; I needed to add the following to
the form tag

enctype="multipart/form-data"

it worked perfectly after that

thanks again
Adam

Hello (e-mail address removed),

does your client's added form have the runat="server" attribute?!
I'd recommend to test the actions on the standard page - take the source
of your generated page and try to do the same in asp.net page
and you will find the source of your problem easily

---
WBR,
Michael  Nemtsev [.NET/C# MVP] :: blog:http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


want a client to be able to add an HTML form to a page via a WYSIWYG
editor and this will be a basic HTML fileinput form with a submit
button.
The above renders fine but in my codebehind in the !Page.IsPostBack in
the Page_Load event I do the following- Hide quoted text -

- Show quoted text -
 
Back
Top