Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 31st, 2006, 01:15 PM
Friend of Wrox
Points: 2,813, Level: 22
Points: 2,813, Level: 22 Points: 2,813, Level: 22 Points: 2,813, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 427
Thanks: 57
Thanked 2 Times in 2 Posts
Default FileUpLoad to display selected graphic?

I have a page that allows the user to browse to a folder, select a graphic, and upload it to our server. I'd like to display the selected graphic for the user prior to upload to ensure it's the graphic they really want. This seems like a common and simple enough task, but I have been unable to find a way to do it.

I'd like to automatically display the graphic when it's selected, but there appears to be no event on the FileUpLoad control that fires when a file has been selected. And I've tried adding a View Graphic button, which successfully displayed the selected graphic. But the FileUpLoad object loses the selected file name in the post back, so the user has to reselect it to upload it.

Is there a way to accomplish this in native ASP.NET (i.e. - WITHOUT using any third party products)?
Reply With Quote
  #2 (permalink)  
Old April 4th, 2006, 08:23 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Sure, handle the event on the client side so there is no need for postback
        FileUpload1.Attributes.Add("OnChange", "alert('Boo');" + Image1.UniqueID.Replace("$","_") + ".src=this.value;");


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Selected value from dropdown menu wont display. mizjinx Classic ASP Databases 0 May 20th, 2007 08:24 PM
Datagrid - selected item display advice janetb ASP.NET 1.0 and 1.1 Basics 2 May 9th, 2006 02:56 PM
retrieve and display selected results babywind BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 February 11th, 2005 04:23 AM
display value of selected radio in the textbox hosefo81 Javascript How-To 1 February 1st, 2004 06:57 AM



All times are GMT -4. The time now is 02:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.