HTML Form inside ASP.NET form and fileupload

Discussion in 'ASP .Net' started by admlangford@gmail.com, May 17, 2008.

  1. Guest

    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
     
    , May 17, 2008
    #1
    1. Advertising

  2. Hello ,

    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
    >
     
    Michael Nemtsev [MVP], May 17, 2008
    #2
    1. Advertising

  3. Guest

    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] <> wrote:
    > Hello ,
    >
    > 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 -
     
    , May 18, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    2
    Views:
    6,119
  2. marko
    Replies:
    0
    Views:
    380
    marko
    Dec 8, 2006
  3. Gert
    Replies:
    3
    Views:
    853
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 10, 2007
  4. gremlin321

    fileupload inside tab control

    gremlin321, Jul 24, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    2,853
    sindhuaduru
    Jan 25, 2012
  5. jobs
    Replies:
    0
    Views:
    832
Loading...

Share This Page