Problem with Keydown on FileUpload control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Problem with Keydown on FileUpload control

  1. #1
    Join Date
    Apr 2008
    Posts
    5

    Problem with Keydown on FileUpload control

    Hi all,

    am using Html FileUpload control and i have used the applied the css by following the intructions provided in following link to change the appearance of the browse button.

    http://www.dreamincode.net/forums/showtopic15621.htm

    this functions well when i use mouse clicks to select file an update the files to some location on server.

    but when i bring the focus on to the control and press enter key Or space bar file browser gets opened but after selected the file; the selected file is not getting loaded in to the fileUpload control to save the file at some location.

    if (UploadFileName.PostedFile != null)
    {
    string strfilename = UploadFileName.PostedFile.FileName;
    string filePathOnserver = Server.MapPath(".") + "\\CustomReports\\" + reportName;
    string path = HttpContext.Current.Server.MapPath(".");
    UploadFileName.PostedFile.SaveAs(filePathOnserver);
    }

    am not getting the "UploadFileName.PostedFile.FileName" and getting the file size=0 when i select the file(when the file browser is opened by keydown event).

    it is functioning fine when i make a selection by opening file browser by mouse click event.

    Is the any difference in opening file Browser by Click event and KeydownEvent?

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    In what keydown event do you have the code?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Apr 2008
    Posts
    5
    code is written in "OK" button which is on the same page.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Does the OK button have focus when you hit the Enter Key?

    Is there an "AcceptButton" property on the page?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Apr 2008
    Posts
    5
    no! actually my page is accessed by master page.
    and where should i keep this property.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Problem loading a JPG into an image control
    By davidpopovich in forum VB Classic
    Replies: 6
    Last Post: 10-30-2007, 03:37 PM
  2. Problem with Handling Rich Text Box Control in VB 6.0
    By kiran.mate in forum VB Classic
    Replies: 8
    Last Post: 10-30-2007, 02:59 PM
  3. Problem with Animation control and avi file
    By Vidhi in forum VB Classic
    Replies: 2
    Last Post: 06-03-2006, 01:30 AM
  4. Image Edit Control
    By Sinni in forum VB Classic
    Replies: 1
    Last Post: 03-06-2003, 05:50 PM
  5. ADO Data Control Problem
    By Kamal in forum VB Classic
    Replies: 0
    Last Post: 06-19-2000, 08:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center