Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HTML Form inside ASP.NET form and fileupload

Reply
Thread Tools

HTML Form inside ASP.NET form and fileupload

 
 
admlangford@gmail.com
Guest
Posts: n/a
 
      05-17-2008
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
 
Reply With Quote
 
 
 
 
Michael Nemtsev [MVP]
Guest
Posts: n/a
 
      05-17-2008
Hello http://www.velocityreviews.com/forums/(E-Mail 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
>



 
Reply With Quote
 
 
 
 
admlangford@gmail.com
Guest
Posts: n/a
 
      05-18-2008
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

On May 17, 6:45*pm, Michael Nemtsev [MVP] <(E-Mail Removed)> wrote:
> Hello (E-Mail 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 -


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fileupload inside tab control gremlin321 ASP .Net 4 01-25-2012 01:15 PM
Getting a "normal" HTML form to work inside the server-side form tag Deane ASP .Net 3 08-01-2007 02:33 PM
Use HTML <input type="file" > instead of .Net FileUpload control? Gert ASP .Net 3 07-10-2007 01:01 PM
HTML form inside a ASP.NET form: CMS Mark ASP .Net 2 03-15-2006 07:38 PM
Re: Can We Use EXEC CGI Inside a JavaScript Applet Inside an HTML File? David Dorward HTML 1 06-28-2003 09:30 AM



Advertisments