|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

January 5th, 2009, 09:51 PM
|
|
Authorized User
|
|
Join Date: Dec 2008
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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: - IE allows one to enter path and file name through the textbox (part of the fileupload), but
- 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.
|

January 6th, 2009, 07:01 PM
|
|
Authorized User
|
|
Join Date: Dec 2008
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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: - 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;
- 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 |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |