Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2011, 10:55 AM
Registered User
 
Join Date: Aug 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Upload file in listview

Hi

I am trying to do something similar to this

FileUpload FileUpload1 = (FileUpload)ListView1.InsertItem.FindControl("File Upload1");

We learned this when we were uploading a path to our database with the insert item template.

My question would be how can we use something similar with an Edit item template? I was using the following code with the FileUpload and with the AsyncFileUpload control but it won't work.

AsyncFileUpload AsyncFileUpload1 = (AsyncFileUpload)ListView1.EditItem.FindControl("A syncFileUpload1");

It seems that is different with the edit template.

Please help me!!

Thank you.
 
Old August 31st, 2011, 06:49 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Where are you executing this code? You should be able to do this from the ItemEditing event, provided you don't have the control wrapped in an UpdatePanel in which case the upload control won't work as expected.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
diegoorjuela (September 1st, 2011)
 
Old September 1st, 2011, 10:00 AM
Registered User
 
Join Date: Aug 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

You were right my mistake was with the UpdatePanel I was using it. Now it is working.

I am working with the ItemUpdating event because when I tried the ItemEditing I got an exception because it did not allow time to upload the file so with the ItemUpdating first I can upload the file and the event checks. I really appreciate your help.

When are you planning to write other book as good as this one but with more advanced topics? I really liked the approach that you used with a real applications.

Thanks a lot.
 
Old September 1st, 2011, 01:03 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>>When are you planning to write other book as good as this one but with more advanced topics?

When somebody puts 48 hours in a day ;-) In other words, no concrete plans....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate File Format of File Upload to Database Not Working in Codefile in C#... dmacklin2010 BOOK: Beginning ASP.NET 2.0 and Databases 0 July 25th, 2011 12:24 PM
Chapter 6, Ajax File Manager, error in upload.php file kenj BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 4 June 4th, 2010 08:46 PM
Clear the filepath details of File Upload Control after saving a file DineshGirij008 C# 2005 0 March 7th, 2009 03:52 AM
Filter File Types in ASP.NET File Upload ramuis78 ASP.NET 2.0 Basics 2 May 31st, 2007 10:50 AM
Whole Folder upload(Multi file Upload) ramasamy_rams XML 1 September 9th, 2005 12:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.