Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. fileupload.hasfile always return false ???

fileupload.hasfile always return false ???

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Priyagdpl
    wrote on last edited by
    #1

    if (FileUpload1.HasFile == true) { FileUpload1.SaveAs(Server.MapPath("~/AdminSection/Attachment/"+FileUpload1.FileName.ToString())); } hi, anybody knows, what may be the possibility by which this condition alwz return false. :)

    B A A 3 Replies Last reply
    0
    • P Priyagdpl

      if (FileUpload1.HasFile == true) { FileUpload1.SaveAs(Server.MapPath("~/AdminSection/Attachment/"+FileUpload1.FileName.ToString())); } hi, anybody knows, what may be the possibility by which this condition alwz return false. :)

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      In your case are you using AJAX? If yes then FileUpload1.HasFile return always false.


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

      1 Reply Last reply
      0
      • P Priyagdpl

        if (FileUpload1.HasFile == true) { FileUpload1.SaveAs(Server.MapPath("~/AdminSection/Attachment/"+FileUpload1.FileName.ToString())); } hi, anybody knows, what may be the possibility by which this condition alwz return false. :)

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Priyagdpl wrote:

        what may be the possibility by which this condition alwz return false.

        I am agree with Blue_Boy. I guess you are using FileUpload Control inside update panel. Here is an workaround. UpdatePanel-FileUpload Control[^]

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

        1 Reply Last reply
        0
        • P Priyagdpl

          if (FileUpload1.HasFile == true) { FileUpload1.SaveAs(Server.MapPath("~/AdminSection/Attachment/"+FileUpload1.FileName.ToString())); } hi, anybody knows, what may be the possibility by which this condition alwz return false. :)

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          You cannot upload using AJAX. Rather if it is withing updatepanel use PostBackTrigger to do your job.:rose:

          Abhishek Sur


          My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

          **Don't forget to click "Good Answer" if you like to.

          P 1 Reply Last reply
          0
          • A Abhishek Sur

            You cannot upload using AJAX. Rather if it is withing updatepanel use PostBackTrigger to do your job.:rose:

            Abhishek Sur


            My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

            **Don't forget to click "Good Answer" if you like to.

            P Offline
            P Offline
            Priyagdpl
            wrote on last edited by
            #5

            Thanx

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups