FormView and FileUpload

Discussion in 'ASP .Net' started by Islamegy®, May 17, 2006.

  1. Islamegy®

    Islamegy® Guest

    I'm use FormView for editing a photo gallery... I add FileUpload control to
    upload images to the Gallery.

    I'm binding my Formview to objectdatasource
    i tried upload images onItemInserting & onItemUpdating but no luck..
    FindControl() didn't work and can't find my fileUpload control..
    any help plzzzzzzzzzz??
    I just upgraded to .net 2 and find to much problems with FindControl() in
    template controls..
    and also i face too many problems with objectdatasource
     
    Islamegy®, May 17, 2006
    #1
    1. Advertising

  2. Islamegy®

    vMike Guest

    "Islamegy®" <Islamegy@Private.4me> wrote in message
    news:...
    > I'm use FormView for editing a photo gallery... I add FileUpload control

    to
    > upload images to the Gallery.
    >
    > I'm binding my Formview to objectdatasource
    > i tried upload images onItemInserting & onItemUpdating but no luck..
    > FindControl() didn't work and can't find my fileUpload control..
    > any help plzzzzzzzzzz??
    > I just upgraded to .net 2 and find to much problems with FindControl() in
    > template controls..
    > and also i face too many problems with objectdatasource
    >
    >

    You might use something like this. I use it for textboxes, but i would think
    it would work for a fileinput control too.
    dim ctl as FileUpoad =
    ctype(yourformviewname.findcontrol("yourcontrolidname"),FileUpoad)
    mike
     
    vMike, May 17, 2006
    #2
    1. Advertising

  3. Islamegy®

    Islamegy® Guest

    Actually this didn't work:
    FileUpload fu =(FileUpload)yourformviewname.findcontrol("myFileUpload1");

    and after investigate anf try & error it worked like this
    FileUpload fu
    =(FileUpload)yourformviewname.Row.FindControl("myFileUpload1");

    So i Discovered i must select findcontrol in the current Row even the
    FormView display only one row per page!!!





    "vMike" <> wrote in message
    news:...
    >
    > "Islamegy®" <Islamegy@Private.4me> wrote in message
    > news:...
    >> I'm use FormView for editing a photo gallery... I add FileUpload control

    > to
    >> upload images to the Gallery.
    >>
    >> I'm binding my Formview to objectdatasource
    >> i tried upload images onItemInserting & onItemUpdating but no luck..
    >> FindControl() didn't work and can't find my fileUpload control..
    >> any help plzzzzzzzzzz??
    >> I just upgraded to .net 2 and find to much problems with FindControl() in
    >> template controls..
    >> and also i face too many problems with objectdatasource
    >>
    >>

    > You might use something like this. I use it for textboxes, but i would
    > think
    > it would work for a fileinput control too.
    > dim ctl as FileUpoad =
    > ctype(yourformviewname.findcontrol("yourcontrolidname"),FileUpoad)
    > mike
    >
    >
     
    Islamegy®, May 18, 2006
    #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. Chris
    Replies:
    0
    Views:
    1,173
    Chris
    May 9, 2006
  2. marygfrc

    Formview error with fileupload

    marygfrc, Jun 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    marygfrc
    Jun 15, 2006
  3. Chris
    Replies:
    5
    Views:
    515
    Jon Paal [MSMD]
    Mar 31, 2007
  4. RosH
    Replies:
    0
    Views:
    450
  5. =?Utf-8?B?Z292ZXI=?=

    FileUpload Control in FormView using ObjectDataSource

    =?Utf-8?B?Z292ZXI=?=, Sep 2, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    744
    =?Utf-8?B?Z292ZXI=?=
    Sep 2, 2007
Loading...

Share This Page