Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 5th, 2009, 09:51 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default fileupload control - disable input

I use a fileupload control on one of my asp.net page. It turned out that fileupload behaves differently with IE and Firefox:
  1. IE allows one to enter path and file name through the textbox (part of the fileupload), but
  2. Firefox only allows one to select file through through file dialog and the textbox is disabled/readonly.
I actually like Firefox behavior better, saving some error checking. The question is how to make IE behave the same way... I can easily add event handler through javascript to handle this, make keypress etc always return false. But... is there a simpler way, for example through some sort of property setting...

Also, with Firefox, when one clicks the textbox area, it automatically brings up the file dialog. Can I do this with IE?? (haven't actually tried, but while I am typing... this came to my mind: maybe I can trigger the click even of the upload button, when one clicks inside the textbox...)

If you have any experience with this, please share...

Last edited by PeterPeiGuo; January 5th, 2009 at 09:53 PM..
  #2 (permalink)  
Old January 6th, 2009, 07:01 PM
Friend of Wrox
 
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

Try the idea I wrote in the oringinal post, and added javascript to handle both onkeypress and onkeydown events. Worked perfectly.

What I couldn't do is: with Firefox, if you click on the textbox area, it also brings up the file dialog, I would like IE to mimic that. I tried two things, none worked:
  1. added onclick event handler, that does not nothing, I guess IE only treat a click on the browse button as a true click for the uploader, but not if you click the textbox area;
  2. added onfocus event handler, that worked... however the onfocus can easily be triigered when I didn't expect - didn't like that.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Access denied error when using FileUpload Control mii2029 ASP.NET 3.5 Basics 0 October 25th, 2008 05:45 PM
Problem to implement CSSClas on fileupload control azizur123 ASP.NET 2.0 Professional 1 October 13th, 2008 09:50 AM
FileUpload control aliirfan84 ASP.NET 2.0 Professional 1 June 2nd, 2007 03:37 PM
FileUpload Control MunishBhatia ASP.NET 2.0 Basics 2 December 6th, 2006 04:03 AM
FileUpload control -- file size detection ekwong ASP.NET 2.0 Basics 3 November 7th, 2006 06:32 PM



All times are GMT -4. The time now is 06:45 AM.


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