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. how to use fileupload control in usercontrol and save the file or image in a folder

how to use fileupload control in usercontrol and save the file or image in a folder

Scheduled Pinned Locked Moved ASP.NET
tutorial
4 Posts 2 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.
  • G Offline
    G Offline
    gaurav mangal
    wrote on last edited by
    #1

    hi everyone i am using fileupload control in usercontrol but i am not able to save it when i am calling this to any page . plz suggest me . thanks inadvance gaurav

    S 1 Reply Last reply
    0
    • G gaurav mangal

      hi everyone i am using fileupload control in usercontrol but i am not able to save it when i am calling this to any page . plz suggest me . thanks inadvance gaurav

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #2

      How you are accessing the control in other pages. Or what problem you are getting? Did you try by creating a public property in the control, That return required information of the fileupload control?

      G 1 Reply Last reply
      0
      • S Sherin Iranimose

        How you are accessing the control in other pages. Or what problem you are getting? Did you try by creating a public property in the control, That return required information of the fileupload control?

        G Offline
        G Offline
        gaurav mangal
        wrote on last edited by
        #3

        thanks for the response actually i have fileupload control in a usercontrol for retriveing the name of the file or image i am using property: public string pic { get { return cchildpic.FileName; } } and at code behind this code: if (cchildpic.FileName != "") { cchildpic.PostedFile.SaveAs("C:/Upload1" + cchildpic.FileName); } and after that i am using this usercontrol at page2 by drag and drop the user control . this is the small part of the app. if more require then i will give more explanation about app. thanks...gaurav

        G 1 Reply Last reply
        0
        • G gaurav mangal

          thanks for the response actually i have fileupload control in a usercontrol for retriveing the name of the file or image i am using property: public string pic { get { return cchildpic.FileName; } } and at code behind this code: if (cchildpic.FileName != "") { cchildpic.PostedFile.SaveAs("C:/Upload1" + cchildpic.FileName); } and after that i am using this usercontrol at page2 by drag and drop the user control . this is the small part of the app. if more require then i will give more explanation about app. thanks...gaurav

          G Offline
          G Offline
          gaurav mangal
          wrote on last edited by
          #4

          HI this problem have been shortedout .now images stored in a folder properly.but i am using session at page 2 to take the name of the picture at page 2 like that; Session["p1"] = ctcchild1.pic; it gives right value at page 2. but at page i am using this: Image1.ImageUrl = "C:\\image" + Session["p1"].ToString(); at this page session value did not give any value . give blank value. plz suggest me . thanks.....gaurav

          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