473,287 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

FormView and FileUpload

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

May 17 '06 #1
2 2902

"Islamegy®" <Is******@Private.4me> wrote in message
news:ug**************@TK2MSFTNGP02.phx.gbl...
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("yourcontrolidn ame"),FileUpoad)
mike
May 17 '06 #2
Actually this didn't work:
FileUpload fu =(FileUpload)yourformviewname.findcontrol("myFileU pload1");

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

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

"vMike" <Mi****************@noZorY.geZwaYrrenY.com> wrote in message
news:98********************@comcast.com...

"Islamegy®" <Is******@Private.4me> wrote in message
news:ug**************@TK2MSFTNGP02.phx.gbl...
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("yourcontrolidn ame"),FileUpoad)
mike

May 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris | last post by:
I am using the formview in conjunction with the object datasource. On basic textual data it updates fine via the the update method but I would like to have a pdf file to upload. What is the best...
0
by: Chris | last post by:
I want to display a formview based on an objectdatasource. One of the things on the formview will be a link to a pdf. When I go into the edit template I would like a fileupload to display, which...
0
by: sandya | last post by:
here is the code i tried string ss; //FileUpload FileUpload1 = new FileUpload(); Label Labeltxt = new Label(); //FileUpload1 = FormView1.FindControl("FileUpLoad1") as FileUpload; FileUpload...
1
by: Horace Nunley | last post by:
Hi, in my formview "insertItem" template, I have a fileupload control that I need to handle when the page is saved. I can't get to that control, or any of the controls thru code. What gives? ...
2
by: sck10 | last post by:
Hello, I have 3 objects: LinkButton GridView FormView The LinkButton is used to open the FormView in Insert mode. The GridView provides a list of products. When the "Select" link is
6
by: Chris | last post by:
I want do my insert to a database using a formview bound to an objectdatasource. I also want to upload a file. I'm quite new to and this is just test code but Is there any way I can pass the file...
0
by: RosH | last post by:
Dear All, Please find below an Inserting Event code expected to trigger just before the insert event of a FormView control. Everything works just fine but the event throws an exception that the...
0
by: =?Utf-8?B?Z292ZXI=?= | last post by:
Hello, I have a Formview in insert mode with a fileUpload control on it. I'm trying to get the contents of the uploaded file passed to my ObjectDataSource to be persisted to my database. The...
1
by: bogdan | last post by:
Hi, I have a FormView where one of the items is a file name. All items come from a single data source. I'd like to have the file name also displayed in a FileUpload control on the same page. ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.