Wrox Programmer Forums
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 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 January 22nd, 2011, 03:01 AM
Authorized User
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 72
Thanks: 17
Thanked 0 Times in 0 Posts
Unhappy File Upload trouble

Hi,

I have a FileUpload tool to upload files on server, on my web page.
And 2 buttons(of which 1 button is hidden).

On 1st Button click , the second button becomes visible. And on this 2nd Button click the file should be uploaded.

Now what happens is USER selects a file through FileUpload and Clicks on BUTTON 1, then BUTTON 2 becomes visible AND on this BUTTON 2 click, the file should be uploaded.

But its not working Coz on BUTTON 1 click, the Page gets refreshed & value of FILEUPLOAD becomes none.

How to solve this trouble?

Thank You....!!

"He can who thinks he can, and he canÕt who thinks he canÕt."
Anup

Last edited by anup.maverick; January 22nd, 2011 at 03:03 AM..
 
Old January 22nd, 2011, 04:01 AM
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,

You have a few options:

1) Upload the file when button A gets clicked, store it somewhere on the server and use it again when button B gets clicked.

2) Show button B client side; either directly with some JavaScript and CSS, or use an AJAX like callback mechanism if you need server side logic to determine the visibility.

Hope this helps,

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!
 
Old January 22nd, 2011, 05:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

To continue your other thread, if you want to check if the file already exists, you need to submit it to the server first, store it with a temporary name and then change the name if the user decides to overwrite it in step 2.

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
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
Trouble in this line 'Upload.SaveAs("Path")' tarduk2004 General .NET 2 May 3rd, 2007 07:32 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.